From 18f7e9261c885e953f220ba6836e8bca43a6fc88 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Apr 2016 13:40:58 +0000 Subject: contact list groups: - finally database is not used anymore (only as a settings' storage); - MGROUP type introduced to replace HANDLE for group ids; - MS_CLIST_GROUP* services became Clist_Group* functions; - CLIST_INTERFACE members pfnGetGroupName & pfnRenameGroup also transformed into static Clist_Group* functions git-svn-id: http://svn.miranda-ng.org/main/trunk@16659 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Sametime/src/userlist.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'protocols/Sametime') diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 2b85a75c0e..d9ea2ea318 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -48,15 +48,9 @@ void CSametimeProto::AddGroup(const char* name, bool expanded) if (name && mir_strcmp(name, Translate("None")) == 0) return; - ptrT ptszGroup(mir_utf8decodeT(name)); - HANDLE hGroup = Clist_GroupExists(ptszGroup); - if (hGroup == NULL) { - hGroup = Clist_CreateGroup(NULL, ptszGroup); - if (hGroup) { - CallService(MS_CLUI_GROUPADDED, (WPARAM)hGroup, 0); - CallService(MS_CLIST_GROUPSETEXPANDED, (WPARAM)hGroup, expanded ? 1 : 0); - } - } + MGROUP hGroup = Clist_GroupCreate(NULL, ptrT(mir_utf8decodeT(name))); + CallService(MS_CLUI_GROUPADDED, hGroup, 0); + Clist_GroupSetExpanded(hGroup, expanded); } MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) @@ -245,10 +239,10 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) //group_open = (db_get_b(0, szProtoGroups, buff, 0) == 1); ptrT ptszGroup(mir_utf8decodeT(group_alias)); - HANDLE hGroup = Clist_GroupExists(ptszGroup); + MGROUP hGroup = Clist_GroupExists(ptszGroup); if (hGroup) { - int expanded; - CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, (LPARAM)&expanded); + DWORD expanded; + Clist_GroupGetName(hGroup, &expanded); group_open = (expanded != 0); } else { -- cgit v1.2.3