forked from MirrorHub/mautrix-whatsapp
Read pushnames from historical messages
This commit is contained in:
parent
5341d79093
commit
00088c12e5
1 changed files with 9 additions and 1 deletions
|
@ -393,6 +393,14 @@ func (portal *Portal) backfill(source *User, messages []*waProto.WebMessageInfo)
|
||||||
} else {
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if webMsg.GetPushName() != "" && webMsg.GetPushName() != "-" {
|
||||||
|
changed, _, err := source.Client.Store.Contacts.PutPushName(info.Sender, webMsg.GetPushName())
|
||||||
|
if err != nil {
|
||||||
|
source.log.Errorfln("Failed to save push name of %s from historical message in device store: %v", info.Sender, err)
|
||||||
|
} else if changed {
|
||||||
|
source.log.Debugfln("Got push name %s for %s from historical message", webMsg.GetPushName(), info.Sender)
|
||||||
|
}
|
||||||
|
}
|
||||||
puppet := portal.getMessagePuppet(source, info)
|
puppet := portal.getMessagePuppet(source, info)
|
||||||
intent := puppet.IntentFor(portal)
|
intent := puppet.IntentFor(portal)
|
||||||
if intent.IsCustomPuppet && !portal.bridge.Config.CanDoublePuppetBackfill(puppet.CustomMXID) {
|
if intent.IsCustomPuppet && !portal.bridge.Config.CanDoublePuppetBackfill(puppet.CustomMXID) {
|
||||||
|
@ -457,7 +465,7 @@ func (portal *Portal) parseWebMessageInfo(webMsg *waProto.WebMessageInfo) *types
|
||||||
MessageSource: types.MessageSource{
|
MessageSource: types.MessageSource{
|
||||||
Chat: portal.Key.JID,
|
Chat: portal.Key.JID,
|
||||||
IsFromMe: webMsg.GetKey().GetFromMe(),
|
IsFromMe: webMsg.GetKey().GetFromMe(),
|
||||||
IsGroup: false,
|
IsGroup: portal.Key.JID.Server == types.GroupServer,
|
||||||
},
|
},
|
||||||
ID: webMsg.GetKey().GetId(),
|
ID: webMsg.GetKey().GetId(),
|
||||||
PushName: webMsg.GetPushName(),
|
PushName: webMsg.GetPushName(),
|
||||||
|
|
Loading…
Reference in a new issue