summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp11
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp7
2 files changed, 10 insertions, 8 deletions
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index 0f53a249fd..2c8fead4ea 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -37,17 +37,17 @@ void CIcqProto::ProcessBuddyList(const JSONNode &ev)
setWString(hContact, "IcqGroup", szGroup);
- CMStringW mirGroup(db_get_sm(hContact, "CList", "Group"));
+ ptrW mirGroup(Clist_GetGroup(hContact));
if (mirGroup != szGroup)
bEnableMenu = true;
- if (mirGroup.IsEmpty()) {
+ if (mirGroup) {
if (!bCreated) {
Clist_GroupCreate(0, szGroup);
bCreated = true;
}
- db_set_ws(hContact, "CList", "Group", szGroup);
+ Clist_SetGroup(hContact, szGroup);
}
}
}
@@ -81,13 +81,14 @@ void CIcqProto::ProcessDiff(const JSONNode &ev)
setWString(hContact, "IcqGroup", szGroup);
- if (db_get_sm(hContact, "CList", "Group").IsEmpty()) {
+ ptrW wszGroup(Clist_GetGroup(hContact));
+ if (!wszGroup) {
if (!bCreated) {
Clist_GroupCreate(0, szGroup);
bCreated = true;
}
- db_set_ws(hContact, "CList", "Group", szGroup);
+ Clist_SetGroup(hContact, szGroup);
}
}
}
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp
index 49e5c4fb93..87dd35189a 100644
--- a/protocols/ICQ-WIM/src/proto.cpp
+++ b/protocols/ICQ-WIM/src/proto.cpp
@@ -169,9 +169,10 @@ INT_PTR CIcqProto::UploadGroups(WPARAM, LPARAM)
if (isChatRoom(it))
continue;
- CMStringW wszIcqGroup(getMStringW(it, "IcqGroup")), wszMirGroup(db_get_wsm(it, "CList", "Group"));
- if (wszMirGroup.IsEmpty())
- wszMirGroup = L"General";
+ CMStringW wszIcqGroup(getMStringW(it, "IcqGroup"));
+ ptrW wszMirGroup(Clist_GetGroup(it));
+ if (!wszMirGroup)
+ wszMirGroup = mir_wstrdup(L"General");
if (wszIcqGroup != wszMirGroup)
MoveContactToGroup(it, wszIcqGroup, wszMirGroup);
}