diff options
author | George Hazan <george.hazan@gmail.com> | 2024-05-06 17:42:52 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-05-06 17:42:52 +0300 |
commit | 630d28997003864c1f8f5f63083e90abfeac97d7 (patch) | |
tree | cfd318f95fe39270c64e3ddaf40c40e82295eb06 /protocols | |
parent | 7e73f86c731078edc5f84a4066f2299fbf240201 (diff) |
fixes #4392 (Discord: не работает подгрузка истории чата с сервера)
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/Discord/src/utils.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp index bcc5c5225b..bb4d6af363 100644 --- a/protocols/Discord/src/utils.cpp +++ b/protocols/Discord/src/utils.cpp @@ -102,7 +102,19 @@ SnowFlake CDiscordProto::getId(MCONTACT hContact, const char *szSetting) if (db_get(hContact, m_szModuleName, szSetting, &dbv))
return 0;
- SnowFlake result = (dbv.cpbVal == sizeof(SnowFlake)) ? *(SnowFlake*)dbv.pbVal : 0;
+ SnowFlake result;
+ switch (dbv.type) {
+ case DBVT_BLOB:
+ result = (dbv.cpbVal == sizeof(SnowFlake)) ? *(SnowFlake *)dbv.pbVal : 0;
+ break;
+ case DBVT_ASCIIZ:
+ case DBVT_UTF8:
+ result = _atoi64(dbv.pszVal);
+ break;
+ case DBVT_WCHAR:
+ result = _wtoi64(dbv.pwszVal);
+ break;
+ }
db_free(&dbv);
return result;
}
|