Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
-
ff8e7bb6
by Philipp Hörist at 2019-10-05T11:16:42Z
-
6a89fcfb
by Philipp Hörist at 2019-10-05T21:52:59Z
2 changed files:
Changes:
| ... | ... | @@ -40,7 +40,23 @@ class BaseMessage: |
| 40 | 40 |
|
| 41 | 41 |
def _process_message_base(self, _con, stanza, properties):
|
| 42 | 42 |
properties.type = self._parse_type(stanza)
|
| 43 |
- properties.jid = stanza.getFrom()
|
|
| 43 |
+ |
|
| 44 |
+ # Determine remote JID
|
|
| 45 |
+ if properties.is_carbon_message and properties.carbon.is_sent:
|
|
| 46 |
+ properties.jid = stanza.getTo()
|
|
| 47 |
+ |
|
| 48 |
+ elif properties.is_mam_message and not properties.type.is_groupchat:
|
|
| 49 |
+ own_jid = self._client.get_bound_jid()
|
|
| 50 |
+ if own_jid.bareMatch(stanza.getFrom()):
|
|
| 51 |
+ properties.jid = stanza.getTo()
|
|
| 52 |
+ else:
|
|
| 53 |
+ properties.jid = stanza.getFrom()
|
|
| 54 |
+ |
|
| 55 |
+ else:
|
|
| 56 |
+ properties.jid = stanza.getFrom()
|
|
| 57 |
+ |
|
| 58 |
+ properties.from_ = stanza.getFrom()
|
|
| 59 |
+ properties.to = stanza.getTo()
|
|
| 44 | 60 |
properties.id = stanza.getID()
|
| 45 | 61 |
properties.self_message = self._parse_self_message(stanza, properties)
|
| 46 | 62 |
|
| ... | ... | @@ -495,6 +495,8 @@ class MessageProperties: |
| 495 | 495 |
self.type = MessageType.NORMAL
|
| 496 | 496 |
self.id = None
|
| 497 | 497 |
self.stanza_id = None
|
| 498 |
+ self.from_ = None
|
|
| 499 |
+ self.to = None
|
|
| 498 | 500 |
self.jid = None
|
| 499 | 501 |
self.subject = None
|
| 500 | 502 |
self.body = None
|