diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 6 | ||||
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 60e585e801..16fafbf871 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -470,7 +470,7 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio break;
}
if (!number.empty())
- fmessage.remote_resource = number;
+ fmessage.media_url = number;
}
}
}
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index c34f9e8e1b..f5d1545c04 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -327,6 +327,12 @@ void WhatsAppProto::onGroupInfo(const std::string &jid, const std::string &owner void WhatsAppProto::onGroupMessage(const FMessage &pMsg)
{
+ // we need to add a contact, so there's no difference at all
+ if (pMsg.media_wa_type == FMessage::WA_TYPE_CONTACT) {
+ onMessageForMe(pMsg);
+ return;
+ }
+
WAChatInfo *pInfo = SafeGetChat(pMsg.key.remote_jid);
if (pInfo == NULL) {
pInfo = InitChat(pMsg.key.remote_jid, "");
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index dd32451850..390ad9a5dc 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -11,7 +11,7 @@ void WhatsAppProto::onMessageForMe(const FMessage &pMsg) {
// someone sent us a contact. launch contact addition dialog
if (pMsg.media_wa_type == FMessage::WA_TYPE_CONTACT) {
- MCONTACT hContact = AddToContactList(pMsg.remote_resource, pMsg.media_name.c_str());
+ MCONTACT hContact = AddToContactList(pMsg.media_url, pMsg.media_name.c_str());
ADDCONTACTSTRUCT acs = { 0 };
acs.handleType = HANDLE_CONTACT;
|