fix chats renamed to channels
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
0cdcce3102
commit
e4fac6e106
|
@ -51,9 +51,11 @@ func main() {
|
||||||
|
|
||||||
// setup work
|
// setup work
|
||||||
workConfig := WorkUnitConfig{
|
workConfig := WorkUnitConfig{
|
||||||
|
Channels: *channels,
|
||||||
|
// starting time for the envelope query
|
||||||
From: uint32(time.Now().Add(-*duration).Unix()),
|
From: uint32(time.Now().Add(-*duration).Unix()),
|
||||||
To: uint32(time.Now().Add(-5 * time.Minute).Unix()), // subtract 5 mins to cater for TTL, time skew on devices etc.
|
// subtract 5 mins to cater for TTL, time skew on devices etc.
|
||||||
Chats: *chats,
|
To: uint32(time.Now().Add(-5 * time.Minute).Unix()),
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -45,7 +45,7 @@ func NewWorkUnit(mailEnode string, config *params.NodeConfig) *WorkUnit {
|
||||||
type WorkUnitConfig struct {
|
type WorkUnitConfig struct {
|
||||||
From uint32
|
From uint32
|
||||||
To uint32
|
To uint32
|
||||||
Chats []string
|
Channels []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute runs the work.
|
// Execute runs the work.
|
||||||
|
@ -62,7 +62,7 @@ func (u *WorkUnit) Execute(config WorkUnitConfig) error {
|
||||||
return fmt.Errorf("failed to add peer: %v", err)
|
return fmt.Errorf("failed to add peer: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, chatName := range config.Chats {
|
for _, chatName := range config.Channels {
|
||||||
chat := protocol.CreatePublicChat(chatName, u.messenger.Timesource())
|
chat := protocol.CreatePublicChat(chatName, u.messenger.Timesource())
|
||||||
if err := u.messenger.Join(chat); err != nil {
|
if err := u.messenger.Join(chat); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue