summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_events.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/skype_events.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index f670130e66..c346e6ff1a 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -33,7 +33,8 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
JSONNode jMsg = JSONNode::parse((char*)pEvent->dbei->pBlob);
if (jMsg)
{
- text.AppendFormat(Translate("Original message:\n\t%s\n"), jMsg["original_message"]["text"].as_string());
+ JSONNode &jOriginalMsg = jMsg["original_message"];
+ text.AppendFormat(Translate("Original message:\n\t%s\n"), jOriginalMsg["text"].as_string().c_str());
JSONNode &jEdits = jMsg["edits"];
for (auto it = jEdits.begin(); it != jEdits.end(); ++it)
{
@@ -43,16 +44,16 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
char szTime[MAX_PATH];
strftime(szTime, sizeof(szTime), "%X %x", localtime(&time));
- text.AppendFormat(Translate("Edited at %s:\n\t%s\n"), szTime, jEdit["text"].as_string());
+ text.AppendFormat(Translate("Edited at %s:\n\t%s\n"), szTime, jEdit["text"].as_string().c_str());
}
}
else
{
#ifdef _DEBUG
- text = (char*)pEvent->dbei->pBlob;
+ text = mir_strdup((char*)pEvent->dbei->pBlob);
#else
- text = Translate("Invalid data!");
+ text = mir_utf8encode(Translate("Invalid data!"));
#endif
}
@@ -131,7 +132,12 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
}
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
{
- pszText = Translate("Incoming call.");
+ pszText = Translate("Incoming call");
+ break;
+ }
+ case SKYPE_DB_EVENT_TYPE_UNKNOWN:
+ {
+ pszText = mir_strdup(CMStringA(FORMAT, "Unknown event, please send this text for developer: \"%s\"", (char*)pEvent->dbei->pBlob));
break;
}
default:
@@ -209,6 +215,10 @@ void CSkypeProto::InitDBEvents()
dbEventType.descr = Translate("URI object");
CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ dbEventType.eventType = SKYPE_DB_EVENT_TYPE_UNKNOWN;
+ dbEventType.descr = Translate("Unknown event");
+ CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+
dbEventType.eventType = SKYPE_DB_EVENT_TYPE_INCOMING_CALL;
dbEventType.descr = Translate("Incoming call");
dbEventType.flags |= DETF_NONOTIFY;