diff options
author | George Hazan <george.hazan@gmail.com> | 2024-08-14 21:08:13 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-08-14 21:08:13 +0300 |
commit | 0b391df2006b89b5ea9df1115dc695e5f44c26ce (patch) | |
tree | b03be693ad5456f1fd42cd38266dfa093ed7368d /protocols/SkypeWeb/src/skype_messages.cpp | |
parent | f41cd01eae037b3021039e68dd37234126037ea8 (diff) |
fixes #4573 (Skypeweb: видео не принимается как файл)
Diffstat (limited to 'protocols/SkypeWeb/src/skype_messages.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 22ad6918b9..14832353d4 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -93,7 +93,7 @@ bool CSkypeProto::ParseMessage(const JSONNode &node, DB::EventInfo &dbei) CMStringW wszContent = node["content"].as_mstring();
std::string strMessageType = node["messagetype"].as_string();
- if (strMessageType == "RichText/Media_GenericFile" || strMessageType == "RichText/UriObject") {
+ if (strMessageType == "RichText/Media_GenericFile" || strMessageType == "RichText/Media_Video" || strMessageType == "RichText/UriObject" ) {
ProcessFileRecv(dbei.hContact, node["content"].as_string().c_str(), dbei);
return false;
}
@@ -224,6 +224,8 @@ void CSkypeProto::ProcessFileRecv(MCONTACT hContact, const char *szContent, DB:: ft->docId = str;
if (auto *str = xmlRoot->Attribute("uri"))
ft->url = str;
+ int iWidth = xmlRoot->IntAttribute("width", -1);
+ int iHeight = xmlRoot->IntAttribute("heighr", -1);
if (auto *str = xmlRoot->Attribute("type"))
pszFileType = str;
if (auto *xml = xmlRoot->FirstChildElement("FileSize"))
@@ -240,7 +242,7 @@ void CSkypeProto::ProcessFileRecv(MCONTACT hContact, const char *szContent, DB:: }
// ordinary file
- if (!mir_strcmp(pszFileType, "File.1") || !mir_strcmp(pszFileType, "Picture.1")) {
+ if (!mir_strcmp(pszFileType, "File.1") || !mir_strcmp(pszFileType, "Picture.1") || !mir_strcmp(pszFileType, "Video.1")) {
MEVENT hEvent;
dbei.flags |= DBEF_TEMPORARY | DBEF_JSON;
if (dbei) {
@@ -256,6 +258,16 @@ void CSkypeProto::ProcessFileRecv(MCONTACT hContact, const char *szContent, DB:: DBVARIANT dbv = { DBVT_UTF8 };
dbv.pszVal = (char*)pszFileType;
db_event_setJson(hEvent, "skft", &dbv);
+
+ dbv.type = DBVT_DWORD;
+ if (iWidth != -1) {
+ dbv.dVal = iWidth;
+ db_event_setJson(hEvent, "w", &dbv);
+ }
+ if (iHeight != -1) {
+ dbv.dVal = iHeight;
+ db_event_setJson(hEvent, "h", &dbv);
+ }
}
else debugLogA("Invalid or unsupported file type <%s> ignored", pszFileType);
}
|