mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-14 17:33:48 +01:00
Fix storing own message sender metadata from history syncs
This commit is contained in:
parent
9a9414db34
commit
4d19d27dad
1 changed files with 3 additions and 3 deletions
|
@ -394,7 +394,7 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)
|
|||
}
|
||||
continue
|
||||
}
|
||||
info := portal.parseWebMessageInfo(webMsg)
|
||||
info := portal.parseWebMessageInfo(source, webMsg)
|
||||
if info == nil {
|
||||
continue
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)
|
|||
}
|
||||
}
|
||||
|
||||
func (portal *Portal) parseWebMessageInfo(webMsg *waProto.WebMessageInfo) *types.MessageInfo {
|
||||
func (portal *Portal) parseWebMessageInfo(source *User, webMsg *waProto.WebMessageInfo) *types.MessageInfo {
|
||||
info := types.MessageInfo{
|
||||
MessageSource: types.MessageSource{
|
||||
Chat: portal.Key.JID,
|
||||
|
@ -490,7 +490,7 @@ func (portal *Portal) parseWebMessageInfo(webMsg *waProto.WebMessageInfo) *types
|
|||
}
|
||||
var err error
|
||||
if info.IsFromMe {
|
||||
info.Sender = portal.Key.Receiver
|
||||
info.Sender = source.JID.ToNonAD()
|
||||
} else if portal.IsPrivateChat() {
|
||||
info.Sender = portal.Key.JID
|
||||
} else if webMsg.GetParticipant() != "" {
|
||||
|
|
Loading…
Reference in a new issue