fix chats renamed to channels

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2020-03-17 11:46:04 +01:00
parent 0cdcce3102
commit e4fac6e106
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
3 changed files with 10 additions and 7 deletions

View File

@ -51,9 +51,11 @@ func main() {
// setup work
workConfig := WorkUnitConfig{
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.
Chats: *chats,
Channels: *channels,
// starting time for the envelope query
From: uint32(time.Now().Add(-*duration).Unix()),
// subtract 5 mins to cater for TTL, time skew on devices etc.
To: uint32(time.Now().Add(-5 * time.Minute).Unix()),
}
var (

View File

@ -43,9 +43,9 @@ func NewWorkUnit(mailEnode string, config *params.NodeConfig) *WorkUnit {
// WorkUnitConfig configures the execution of the work.
type WorkUnitConfig struct {
From uint32
To uint32
Chats []string
From uint32
To uint32
Channels []string
}
// Execute runs the work.
@ -62,7 +62,7 @@ func (u *WorkUnit) Execute(config WorkUnitConfig) error {
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())
if err := u.messenger.Join(chat); err != nil {
return err

1
go.mod
View File

@ -12,4 +12,5 @@ require (
github.com/ethereum/go-ethereum v1.9.5
github.com/spf13/pflag v1.0.3
github.com/status-im/status-go v0.48.2
go.uber.org/zap v1.13.0
)