summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/ex_import
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-01-25 18:34:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-01-25 18:34:51 +0300
commit9885bf54f788e831a80c76001340aa68d31d2aaa (patch)
tree420ab4aa5bf868d4193c965668ae68e5855093b7 /plugins/UserInfoEx/src/ex_import
parentc9d99d1525e2e9374ed0fa10837e82e76c3b9216 (diff)
Group chats: ChatRoomID setting replaced with real protocol id
Diffstat (limited to 'plugins/UserInfoEx/src/ex_import')
-rw-r--r--plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp22
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp2
2 files changed, 5 insertions, 19 deletions
diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
index 301d87c4f3..5393ae538b 100644
--- a/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
+++ b/plugins/UserInfoEx/src/ex_import/classExImContactBase.cpp
@@ -78,7 +78,6 @@ uint8_t CExImContactBase::fromDB(MCONTACT hContact)
uint8_t ret = FALSE;
uint8_t isChatRoom = FALSE;
LPSTR pszProto;
- LPCSTR uidSetting;
DBVARIANT dbv;
_hContact = hContact;
@@ -106,29 +105,16 @@ uint8_t CExImContactBase::fromDB(MCONTACT hContact)
db_free(&dbv);
}
- // unique id (for ChatRoom)
- if (isChatRoom = Contact::IsGroupChat(_hContact, pszProto)) {
- uidSetting = "ChatRoomID";
+ LPCSTR uidSetting = Proto_GetUniqueId(pszProto);
+ if (uidSetting != nullptr) { // valid
_pszUIDKey = mir_strdup(uidSetting);
if (!DB::Setting::GetAsIs(_hContact, pszProto, uidSetting, &_dbvUID)) {
ret = TRUE;
}
}
- // unique id (normal)
+ // fails because the protocol is no longer installed
else {
- uidSetting = Proto_GetUniqueId(pszProto);
- // valid
- if (uidSetting != nullptr && (INT_PTR)uidSetting != CALLSERVICE_NOTFOUND) {
- _pszUIDKey = mir_strdup(uidSetting);
- if (!DB::Setting::GetAsIs(_hContact, pszProto, uidSetting, &_dbvUID)) {
- ret = TRUE;
- }
- }
- // fails because the protocol is no longer installed
- else {
- // assert(ret == TRUE);
- ret = TRUE;
- }
+ ret = TRUE;
}
// nickname
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp
index 1dc8fc82d4..14887c485d 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImVCF.cpp
@@ -1111,7 +1111,7 @@ uint8_t CVCardFileVCF::Export(uint8_t bExportUtf)
// contacts protocol, uin setting, uin value
//
LPCSTR uid = Proto_GetUniqueId(_pszBaseProto);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid) {
+ if (uid) {
CHAR szUID[MAXUID];
if (!db_get_static(_hContact, _pszBaseProto, uid, szUID, sizeof(szUID)))
fprintf(_pFile, "IM;%s;%s:%s\n", _pszBaseProto, uid, szUID);