summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-03-11 19:51:38 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-03-11 19:51:38 +0300
commit367731ae14fcc861178a20527ee8be83b91f8ef3 (patch)
treec5d25c003f1ed09dc88f3236bf832898af8ea4c4 /protocols/Discord/src/proto.cpp
parente8fb7de563970da12871b83c0c5e84775fe71d2d (diff)
Discord: partial support for VoiceService plugin
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r--protocols/Discord/src/proto.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index 98258c6b7d..25cfdaffdc 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -153,6 +153,17 @@ void CDiscordProto::OnModulesLoaded()
HookProtoEvent(ME_GC_BUILDMENU, &CDiscordProto::GroupchatMenuHook);
InitMenus();
+
+ // Voice support
+ if (g_plugin.bVoiceService) {
+ VOICE_MODULE voice = {};
+ voice.cbSize = sizeof(voice);
+ voice.name = m_szModuleName;
+ voice.description = TranslateT("Discord voice call");
+ voice.icon = m_hProtoIcon;
+ voice.flags = VOICE_CAPS_CALL_CONTACT | VOICE_CAPS_VOICE;
+ CallService(MS_VOICESERVICE_REGISTER, (WPARAM)&voice, 0);
+ }
}
void CDiscordProto::OnShutdown()
@@ -164,6 +175,9 @@ void CDiscordProto::OnShutdown()
if (m_hGatewayConnection)
Netlib_Shutdown(m_hGatewayConnection);
+
+ if (g_plugin.bVoiceService)
+ CallService(MS_VOICESERVICE_UNREGISTER, (WPARAM)m_szModuleName, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////