summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-26 12:13:35 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-26 12:13:35 +0000
commite77a19c4e56e50b58783a9fd7ab7e098b51d05f4 (patch)
tree1b5ffd8e40ffd7ba454aeedf835a0ec7721a4d5e /protocols/SkypeWeb
parent1cf949187a4f38580a6ec225472b171d34750f46 (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')
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp23
-rw-r--r--protocols/SkypeWeb/src/skype_menus.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_menus.h1
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h1
4 files changed, 7 insertions, 26 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;
}
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp
index e461ac5b81..0d530c703c 100644
--- a/protocols/SkypeWeb/src/skype_menus.cpp
+++ b/protocols/SkypeWeb/src/skype_menus.cpp
@@ -29,7 +29,6 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
if (this->isChatRoom(hContact))
{
- Menu_ShowItem(ContactMenuItems[CMI_DESTROYCHAT], true);
return 0;
}
@@ -83,13 +82,6 @@ void CSkypeProto::InitMenus()
mi.icolibItem = GetIconHandle("synchistory");
ContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::GetContactHistory>);
-
- mi.pszService = MODULE"/DestroyChat";
- mi.position = CMI_POSITION + CMI_DESTROYCHAT;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_LEAVE);
- mi.ptszName = LPGENT("Destroy room");
- ContactMenuItems[CMI_DESTROYCHAT] = Menu_AddContactMenuItem(&mi);
- CreateServiceFunction(mi.pszService, GlobalService<&CSkypeProto::SvcDestroyChat>);
}
void CSkypeProto::UninitMenus()
diff --git a/protocols/SkypeWeb/src/skype_menus.h b/protocols/SkypeWeb/src/skype_menus.h
index 0b596a6758..e04add88d3 100644
--- a/protocols/SkypeWeb/src/skype_menus.h
+++ b/protocols/SkypeWeb/src/skype_menus.h
@@ -25,7 +25,6 @@ enum
CMI_AUTH_REQUEST,
CMI_AUTH_GRANT,
CMI_GETSERVERHISTORY,
- CMI_DESTROYCHAT,
CMI_MAX // this item shall be the last one
};
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 8f28eac592..b6333cfd8d 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -227,7 +227,6 @@ private:
INT_PTR __cdecl OnJoinChatRoom (WPARAM hContact, LPARAM);
INT_PTR __cdecl OnLeaveChatRoom (WPARAM hContact, LPARAM);
- INT_PTR __cdecl SvcDestroyChat(WPARAM hContact, LPARAM);
void OnChatEvent(JSONNODE *node);
void OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessage);
char *GetChatUsers(const TCHAR *chat_id);