From 8fbb710f69be547c9a1fb45346bbd01db9d23bee Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 19 Sep 2016 11:25:57 +0000 Subject: Chat_AddGroup - even less structures git-svn-id: http://svn.miranda-ng.org/main/trunk@17316 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Sametime/src/conference.cpp | 41 ++++++++++++----------------------- 1 file changed, 14 insertions(+), 27 deletions(-) (limited to 'protocols/Sametime/src') diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 66444363b8..9c2fac9b59 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -109,47 +109,34 @@ void mwServiceConf_conf_opened(mwConference* conf, GList* members) proto->debugLogW(L"mwServiceConf_conf_opened() start"); ptrW tszConfId(mir_utf8decodeW(mwConference_getName(conf))); + ptrW tszConfTitle(mir_utf8decodeW(mwConference_getTitle(conf))); // create new chat session - { - ptrW tszConfTitle(mir_utf8decodeW(mwConference_getTitle(conf))); - - GCSESSION gcs = {}; - gcs.iType = GCW_CHATROOM; - gcs.pszModule = proto->m_szModuleName; - gcs.ptszID = tszConfId; - gcs.ptszName = tszConfTitle; - Chat_NewSession(&gcs); - } - - //add a group - GCDEST gcd = { proto->m_szModuleName, 0 }; - gcd.iType = GC_EVENT_ADDGROUP; - gcd.ptszID = tszConfId; + GCSESSION gcs = {}; + gcs.iType = GCW_CHATROOM; + gcs.pszModule = proto->m_szModuleName; + gcs.ptszID = tszConfId; + gcs.ptszName = tszConfTitle; + Chat_NewSession(&gcs); - GCEVENT gce = { &gcd }; - gce.dwFlags = GCEF_ADDTOLOG; - gce.ptszStatus = TranslateT("Normal"); - - Chat_Event(&gce); + // add a group + Chat_AddGroup(proto->m_szModuleName, tszConfId, TranslateT("Normal")); // add users - gcd.iType = GC_EVENT_JOIN; + GCDEST gcd = { proto->m_szModuleName, tszConfId, GC_EVENT_JOIN }; + GCEVENT gce = { &gcd }; GList *user = members; for (;user; user=user->next) { proto->debugLogW(L"mwServiceConf_conf_opened() add user"); - wchar_t* tszUserName = mir_utf8decodeW(((mwLoginInfo*)user->data)->user_name); - wchar_t* tszUserId = mir_utf8decodeW(((mwLoginInfo*)user->data)->login_id); + ptrW tszUserName(mir_utf8decodeW(((mwLoginInfo*)user->data)->user_name)); + ptrW tszUserId(mir_utf8decodeW(((mwLoginInfo*)user->data)->login_id)); + gce.dwFlags = GCEF_ADDTOLOG; gce.ptszNick = tszUserName; gce.ptszUID = tszUserId; gce.bIsMe = (strcmp(((mwLoginInfo*)user->data)->login_id, proto->my_login_info->login_id) == 0); - Chat_Event( &gce); - - mir_free(tszUserName); - mir_free(tszUserId); } // finalize setup (show window) -- cgit v1.2.3