summaryrefslogtreecommitdiffstats
path: root/bridge/whatsapp
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/whatsapp')
-rw-r--r--bridge/whatsapp/handlers.go2
-rw-r--r--bridge/whatsapp/whatsapp.go28
2 files changed, 16 insertions, 14 deletions
diff --git a/bridge/whatsapp/handlers.go b/bridge/whatsapp/handlers.go
index f0512a74..ff905b04 100644
--- a/bridge/whatsapp/handlers.go
+++ b/bridge/whatsapp/handlers.go
@@ -28,6 +28,8 @@ func (b *Bwhatsapp) handleMessage(message *events.Message) {
return
}
+ b.Log.Infof("Receiving message %#v", msg)
+
switch {
case msg.Conversation != nil || msg.ExtendedTextMessage != nil:
b.handleTextMessage(message.Info, msg)
diff --git a/bridge/whatsapp/whatsapp.go b/bridge/whatsapp/whatsapp.go
index f4d73534..c28b3c89 100644
--- a/bridge/whatsapp/whatsapp.go
+++ b/bridge/whatsapp/whatsapp.go
@@ -113,22 +113,22 @@ func (b *Bwhatsapp) Connect() error {
}
// get user avatar asynchronously
- go func() {
- b.Log.Debug("Getting user avatars..")
-
- for jid := range b.users {
- info, err := b.GetProfilePicThumb(jid)
- if err != nil {
- b.Log.Warnf("Could not get profile photo of %s: %v", jid, err)
- } else {
- b.Lock()
- b.userAvatars[jid] = info.URL
- b.Unlock()
- }
+ // go func() {
+ b.Log.Info("Getting user avatars..")
+
+ for jid := range b.users {
+ info, err := b.GetProfilePicThumb(jid)
+ if err != nil {
+ b.Log.Warnf("Could not get profile photo of %s: %v", jid, err)
+ } else {
+ b.Lock()
+ b.userAvatars[jid] = info.URL
+ b.Unlock()
}
+ }
- b.Log.Debug("Finished getting avatars..")
- }()
+ b.Log.Info("Finished getting avatars..")
+ // }()
return nil
}