diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-26 12:13:35 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-26 12:13:35 +0000 |
commit | e77a19c4e56e50b58783a9fd7ab7e098b51d05f4 (patch) | |
tree | 1b5ffd8e40ffd7ba454aeedf835a0ec7721a4d5e /protocols/SkypeWeb/src/skype_chatrooms.cpp | |
parent | 1cf949187a4f38580a6ec225472b171d34750f46 (diff) |
SkypeWeb:
Chat destoying moved to OnLeaveChatRoom.
MessageBox before destroying chat.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_chatrooms.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index a8324a66e1..4d7981eed5 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -118,7 +118,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) break;
}
case 20:
- //chat_leave(id);
+ OnLeaveChatRoom(FindChatRoom(chat_id), NULL);
break;
case 30:
break;
@@ -242,7 +242,9 @@ INT_PTR CSkypeProto::OnJoinChatRoom(WPARAM hContact, LPARAM) INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM)
{
- if (hContact)
+ if (!IsOnline())
+ return 1;
+ if (hContact && IDYES == MessageBox(NULL, TranslateT("This chat is going to be destroyed forever with all its contents. This action cannot be undone. Are you sure?"), TranslateT("Warning"), MB_YESNOCANCEL | MB_ICONQUESTION))
{
ptrT idT(getTStringA(hContact, "ChatRoomID"));
@@ -254,22 +256,11 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) CallServiceSync(MS_GC_EVENT, SESSION_OFFLINE, reinterpret_cast<LPARAM>(&gce));
CallServiceSync(MS_GC_EVENT, SESSION_TERMINATE, reinterpret_cast<LPARAM>(&gce));
- }
- return 0;
-}
-INT_PTR CSkypeProto::SvcDestroyChat(WPARAM hContact, LPARAM)
-{
- debugLogA(__FUNCTION__);
- if (!IsOnline())
- return 1;
-
- ptrT chatId(db_get_tsa(hContact, m_szModuleName, "ChatRoomID"));
-
- SendRequest(new KickUserRequest(RegToken, _T2A(chatId), SelfSkypeName, Server));
-
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ SendRequest(new KickUserRequest(RegToken, _T2A(idT), SelfSkypeName, Server));
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ }
return 0;
}
|