mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 09:23:51 +01:00
Add more logging to debug chat mute bridging
This commit is contained in:
parent
dbdd3258b2
commit
29254ee29a
1 changed files with 3 additions and 2 deletions
5
user.go
5
user.go
|
@ -691,10 +691,10 @@ func (user *User) updateChatMute(intent *appservice.IntentAPI, portal *Portal, m
|
|||
}
|
||||
var err error
|
||||
if mutedUntil < time.Now().Unix() {
|
||||
user.log.Debugln("Unmuting", portal.MXID)
|
||||
user.log.Debugfln("Portal %s is muted until %d, unmuting...", portal.MXID, mutedUntil)
|
||||
err = intent.DeletePushRule("global", pushrules.RoomRule, string(portal.MXID))
|
||||
} else {
|
||||
user.log.Debugln("Muting", portal.MXID)
|
||||
user.log.Debugfln("Portal %s is muted until %d, muting...", portal.MXID, mutedUntil)
|
||||
err = intent.PutPushRule("global", pushrules.RoomRule, string(portal.MXID), &mautrix.ReqPutPushRule{
|
||||
Actions: []pushrules.PushActionType{pushrules.ActionDontNotify},
|
||||
})
|
||||
|
@ -834,6 +834,7 @@ func (user *User) syncPortals(chatMap map[string]whatsapp.Chat, createAll bool)
|
|||
}
|
||||
create := (chat.LastMessageTime >= user.LastConnection && user.LastConnection > 0) || i < limit
|
||||
if len(chat.Portal.MXID) > 0 || create || createAll {
|
||||
user.log.Debugfln("Syncing chat %+v", chat.Chat.Source)
|
||||
justCreated := len(chat.Portal.MXID) == 0
|
||||
user.syncPortal(chat)
|
||||
user.syncChatDoublePuppetDetails(doublePuppet, chat, justCreated)
|
||||
|
|
Loading…
Reference in a new issue