diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-20 11:34:23 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-20 11:34:23 +0000 |
commit | 8d72d5a048972f29c135f4c7fe8c0e8948bd0e07 (patch) | |
tree | e3af9c4907a2a16c2cb7284ee390d486e29d056c /protocols/SkypeWeb/src/skype_chatrooms.cpp | |
parent | 6c633fcfe931754919fc564a0c683634812e3384 (diff) |
SkypeWeb: Chat fixes.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12962 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_chatrooms.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 92872be218..6d17790e8d 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -330,13 +330,7 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) if (isKick)
{
- GCDEST gcd = { m_szModuleName, ptrT(mir_a2t(chatname)), GC_EVENT_KICK };
- GCEVENT gce = { sizeof(GCEVENT), &gcd };
- gce.ptszUID = ptrT(mir_a2t(target));
- gce.ptszNick = ptrT(mir_a2t(target));
- gce.ptszStatus = ptrT(mir_a2t(initiator));
- gce.time = timestamp;
- CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
+ RemoveChatContact(_A2T(chatname), target, target, true, initiator);
}
else
{
@@ -425,21 +419,32 @@ void CSkypeProto::AddChatContact(const TCHAR *tchat_id, const char *id, const ch CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
-void CSkypeProto::RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name)
+void CSkypeProto::RemoveChatContact(const TCHAR *tchat_id, const char *id, const char *name, bool isKick, const char *initiator)
{
if(IsMe(id))
return;
ptrT tnick(mir_a2t_cp(name, CP_UTF8));
ptrT tid(mir_a2t(id));
+ ptrT tinitiator(mir_a2t(initiator));
- GCDEST gcd = { m_szModuleName, tchat_id, GC_EVENT_PART };
+ GCDEST gcd = { m_szModuleName, tchat_id, isKick ? GC_EVENT_KICK : GC_EVENT_PART };
GCEVENT gce = { sizeof(gce), &gcd };
- gce.dwFlags = GCEF_ADDTOLOG;
- gce.ptszNick = tnick;
- gce.ptszUID = tid;
- gce.time = time(NULL);
- gce.bIsMe = false;
+ if (isKick)
+ {
+ gce.ptszUID = tid;
+ gce.ptszNick = tnick;
+ gce.ptszStatus = tinitiator;
+ gce.time = time(NULL);
+ }
+ else
+ {
+ gce.dwFlags = GCEF_ADDTOLOG;
+ gce.ptszNick = tnick;
+ gce.ptszUID = tid;
+ gce.time = time(NULL);
+ gce.bIsMe = IsMe(id);
+ }
CallServiceSync(MS_GC_EVENT, 0, reinterpret_cast<LPARAM>(&gce));
}
@@ -453,6 +458,7 @@ INT_PTR CSkypeProto::InviteDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM CSkypeProto *ppro = (CSkypeProto*)lParam;
HWND hwndCombo = GetDlgItem(hwndDlg, IDC_CONTACT);
for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName)) {
+ if (ppro->isChatRoom(hContact)) continue;
TCHAR *ptszNick = pcli->pfnGetContactDisplayName(hContact, 0);
int idx = SendMessage(hwndCombo, CB_ADDSTRING, 0, LPARAM(ptszNick));
SendMessage(hwndCombo, CB_SETITEMDATA, idx, hContact);
|