@@ -1285,6 +1285,9 @@ func (cli *Client) encryptMessageForDevices(
|
||||
sessionAddressToJID := make(map[string]types.JID, len(allDevices))
|
||||
sessionAddresses := make([]string, 0, len(allDevices))
|
||||
for _, jid := range allDevices {
|
||||
if jid == ownJID || jid == ownLID {
|
||||
continue
|
||||
}
|
||||
encryptionIdentity := jid
|
||||
if jid.Server == types.DefaultUserServer {
|
||||
// TODO query LID from server for missing entries
|
||||
@@ -1313,10 +1316,10 @@ func (cli *Client) encryptMessageForDevices(
|
||||
|
||||
for _, jid := range allDevices {
|
||||
plaintext := msgPlaintext
|
||||
if jid == ownJID || jid == ownLID {
|
||||
continue
|
||||
}
|
||||
if (jid.User == ownJID.User || jid.User == ownLID.User) && dsmPlaintext != nil {
|
||||
if jid == ownJID || jid == ownLID {
|
||||
continue
|
||||
}
|
||||
plaintext = dsmPlaintext
|
||||
}
|
||||
encrypted, isPreKey, err := cli.encryptMessageForDeviceAndWrap(
|
||||
|
||||
@@ -530,6 +530,9 @@ func (cli *Client) encryptMessageForDevicesV3(
|
||||
sessionAddressToJID := make(map[string]types.JID, len(allDevices))
|
||||
sessionAddresses := make([]string, 0, len(allDevices))
|
||||
for _, jid := range allDevices {
|
||||
if jid == ownID {
|
||||
continue
|
||||
}
|
||||
addr := jid.SignalAddress().String()
|
||||
sessionAddresses = append(sessionAddresses, addr)
|
||||
sessionAddressToJID[addr] = jid
|
||||
@@ -547,11 +550,11 @@ func (cli *Client) encryptMessageForDevicesV3(
|
||||
bundles := cli.fetchPreKeysNoError(ctx, retryDevices)
|
||||
|
||||
for _, jid := range allDevices {
|
||||
if jid == ownID {
|
||||
continue
|
||||
}
|
||||
var dsmForDevice *waMsgTransport.MessageTransport_Protocol_Integral_DeviceSentMessage
|
||||
if jid.User == ownID.User {
|
||||
if jid == ownID {
|
||||
continue
|
||||
}
|
||||
dsmForDevice = dsm
|
||||
}
|
||||
encrypted, err := cli.encryptMessageForDeviceAndWrapV3(ctx, payload, skdm, dsmForDevice, jid, bundles[jid], encAttrs)
|
||||
|
||||
Reference in New Issue
Block a user