diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 15 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_menus.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_menus.h | 1 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 2 |
4 files changed, 27 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 8b9e18e3fe..769c42b5da 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -258,6 +258,21 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) return 0;
}
+INT_PTR CSkypeProto::SvcDestroyChat(WPARAM hContact, LPARAM)
+{
+ debugLogA("CVkProto::SvcDestroyKickChat");
+ if (!IsOnline())
+ return 1;
+
+ ptrA chatId(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID));
+
+ SendRequest(new KickUserRequest(RegToken, chatId, SelfSkypeName, Server));
+
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+
+ return 0;
+}
+
/* CHAT EVENT */
void CSkypeProto::OnChatEvent(JSONNODE *node)
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp index ec2710f29a..e461ac5b81 100644 --- a/protocols/SkypeWeb/src/skype_menus.cpp +++ b/protocols/SkypeWeb/src/skype_menus.cpp @@ -28,7 +28,10 @@ int CSkypeProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
if (this->isChatRoom(hContact))
+ {
+ Menu_ShowItem(ContactMenuItems[CMI_DESTROYCHAT], true);
return 0;
+ }
bool isCtrlPressed = (GetKeyState(VK_CONTROL) & 0x8000) != 0;
bool isAuthNeed = getByte(hContact, "Auth", 0) > 0;
@@ -80,6 +83,13 @@ 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 e04add88d3..0b596a6758 100644 --- a/protocols/SkypeWeb/src/skype_menus.h +++ b/protocols/SkypeWeb/src/skype_menus.h @@ -25,6 +25,7 @@ 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 bd10b13f9d..8f28eac592 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -227,7 +227,7 @@ 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);
|