From 7b247a32b805ec9cf3d0baee8469359a4c67b330 Mon Sep 17 00:00:00 2001 From: Krzysztof Madejski Date: Thu, 14 Feb 2019 11:15:52 +0100 Subject: [PATCH] #475 Clean the code from unneccessary comments --- bridge/whatsapp/whatsapp.go | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/bridge/whatsapp/whatsapp.go b/bridge/whatsapp/whatsapp.go index 9b20a437..b92f8961 100644 --- a/bridge/whatsapp/whatsapp.go +++ b/bridge/whatsapp/whatsapp.go @@ -44,23 +44,11 @@ func New(cfg *bridge.Config) bridge.Bridger { cfg.Log.Fatalf("Missing configuration for WhatsApp bridge: Number") } - // TODO do we need cache? - //newCache, err := lru.New(5000) - //if err != nil { - // cfg.Log.Fatalf("Could not create LRU cache for Slack bridge: %v", err) - //} b := &Bwhatsapp{ Config: cfg, users: make(map[string]whatsapp.Contact), userAvatars: make(map[string]string), - - //uuid: xid.New().String(), - //users: map[string]*slack.User{}, - //channelsByID: map[string]*slack.Channel{}, - //channelsByName: map[string]*slack.Channel{}, - //earliestChannelRefresh: time.Now(), - //earliestUserRefresh: time.Now(), } return b } @@ -181,9 +169,8 @@ func (b *Bwhatsapp) Login() error { // TODO change connection strings to configured ones longClientName:"github.com/rhymen/go-whatsapp", shortClientName:"go-whatsapp"}" prefix=whatsapp // TODO get also a nice logo - // session.Wid - // conn.Info: Wid, Pushname, Connected, Battery, Plugged (TODO notification about unplugged and dead battery) - // jid = strings.Replace(b.conn.Info.Wid, whatsappExt.OldUserSuffix, whatsappExt.NewUserSuffix, 1) + // TODO notification about unplugged and dead battery + // conn.Info: Wid, Pushname, Connected, Battery, Plugged return nil } @@ -232,8 +219,7 @@ func (b *Bwhatsapp) JoinChannel(channel config.ChannelInfo) error { //}) for id, contact := range b.conn.Store.Contacts { if isGroupJid(id) { - // TODO b.Log.Info - fmt.Printf("%s %s\n", contact.Jid, contact.Name) + b.Log.Info("%s %s", contact.Jid, contact.Name) } } return fmt.Errorf("please specify group's JID from the below list instead of the name '%s'", channel.Name) @@ -255,13 +241,6 @@ func (b *Bwhatsapp) JoinChannel(channel config.ChannelInfo) error { func (b *Bwhatsapp) Send(msg config.Message) (string, error) { b.Log.Debugf("=> Receiving %#v", msg) - // msg.Channel target group name - // msg.Username empty - // msg.UserID a weird string , probably slack user id - // msg.Avatar has a nice image - // msg.Timestamp has a nice timestamp with loc(ation) / timezone - // msg.ID empty, // TODO why empty?! - text := whatsapp.TextMessage{ Info: whatsapp.MessageInfo{ // Id: "", // TODO id