diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-19 11:25:57 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-19 11:25:57 +0000 |
commit | 8fbb710f69be547c9a1fb45346bbd01db9d23bee (patch) | |
tree | b49bf9e58c0aa7fdfd49bce0170062454bee4d9e /protocols/Sametime/src/conference.cpp | |
parent | f76565d65450fe2f60913b93938c9a770e8caf4b (diff) |
Chat_AddGroup - even less structures
git-svn-id: http://svn.miranda-ng.org/main/trunk@17316 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Sametime/src/conference.cpp')
-rw-r--r-- | protocols/Sametime/src/conference.cpp | 41 |
1 files changed, 14 insertions, 27 deletions
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)
|