diff options
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 6052c768bc..a14b576f14 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -586,13 +586,11 @@ void WAConnection::parsePresense(ProtocolTreeNode *node) throw(WAException) return;
}
- const string &type = node->getAttributeValue("type");
- if (type == "unavailable") {
- if (m_pEventHandler != NULL)
+ if (m_pEventHandler != NULL) {
+ const string &type = node->getAttributeValue("type");
+ if (type == "unavailable")
m_pEventHandler->onAvailable(from, false);
- }
- else if (type == "available" || type == "") {
- if (m_pEventHandler != NULL)
+ else if (type == "available" || type == "")
m_pEventHandler->onAvailable(from, true);
}
}
|