diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-06 15:05:26 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-06 15:05:26 +0300 |
commit | 239ea74ddedb7d3483d08cd599647edcbe4ab9c4 (patch) | |
tree | a2e5214c3f284aa5b88f21151ff32850e3006abf /protocols | |
parent | d1e1ee5ed76c66af0a05dbad7ba7b27c9aa63d3c (diff) |
fixes #4621 (SkypeWeb: Если я пишу что-то с другого устройства, и потом удаляю, в миранде остаются некие оскропотки от произошедшего)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_polling.cpp | 21 |
2 files changed, 16 insertions, 15 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 297439305d..db01c0308e 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -90,7 +90,15 @@ int CSkypeProto::OnPreCreateMessage(WPARAM, LPARAM lParam) bool CSkypeProto::ParseMessage(const JSONNode &node, DB::EventInfo &dbei)
{
int nEmoteOffset = node["skypeemoteoffset"].as_int();
- CMStringW wszContent = node["content"].as_mstring();
+
+ auto &pContent = node["content"];
+ if (!pContent) {
+ if (dbei)
+ db_event_delete(dbei.getEvent());
+ return false;
+ }
+
+ CMStringW wszContent = pContent.as_mstring();
std::string strMessageType = node["messagetype"].as_string();
if (strMessageType == "RichText/Media_GenericFile" || strMessageType == "RichText/Media_Video" || strMessageType == "RichText/UriObject" ) {
diff --git a/protocols/SkypeWeb/src/skype_polling.cpp b/protocols/SkypeWeb/src/skype_polling.cpp index 20b65abd60..5303c5d190 100644 --- a/protocols/SkypeWeb/src/skype_polling.cpp +++ b/protocols/SkypeWeb/src/skype_polling.cpp @@ -70,25 +70,19 @@ void CSkypeProto::ParsePollData(const char *szData) if (eventId > m_iPollingId)
m_iPollingId = eventId;
- const JSONNode &resType = message["resourceType"];
const JSONNode &resource = message["resource"];
- std::string resourceType = resType.as_string();
- if (resourceType == "NewMessage") {
+ std::string resourceType = message["resourceType"].as_string();
+ if (resourceType == "NewMessage")
ProcessNewMessage(resource);
- }
- else if (resourceType == "UserPresence") {
+ else if (resourceType == "UserPresence")
ProcessUserPresence(resource);
- }
- else if (resourceType == "EndpointPresence") {
+ else if (resourceType == "EndpointPresence")
ProcessEndpointPresence(resource);
- }
- else if (resourceType == "ConversationUpdate") {
+ else if (resourceType == "ConversationUpdate")
ProcessConversationUpdate(resource);
- }
- else if (resourceType == "ThreadUpdate") {
+ else if (resourceType == "ThreadUpdate")
ProcessThreadUpdate(resource);
- }
}
}
@@ -149,9 +143,8 @@ void CSkypeProto::ProcessEndpointPresence(const JSONNode &node) if (privateInfo != NULL) {
std::string epname = privateInfo["epname"].as_string();
- if (!epname.empty()) {
+ if (!epname.empty())
MirVer.AppendFormat(" [%s]", epname.c_str());
- }
}
setString(hContact, "MirVer", MirVer);
|