diff options
-rw-r--r-- | protocols/Discord/src/proto.cpp | 13 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/groupchat.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 13 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 19 | ||||
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 20 | ||||
-rw-r--r-- | protocols/MinecraftDynmap/src/proto.cpp | 17 | ||||
-rw-r--r-- | protocols/MinecraftDynmap/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/Omegle/src/proto.cpp | 19 | ||||
-rw-r--r-- | protocols/Omegle/src/proto.h | 1 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime.cpp | 13 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.cpp | 7 | ||||
-rw-r--r-- | protocols/Sametime/src/sametime_proto.h | 1 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 3 | ||||
-rw-r--r-- | protocols/Twitter/src/proto.cpp | 13 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 22 |
16 files changed, 80 insertions, 86 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 3eb222f68e..b346de4d88 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -92,6 +92,13 @@ CDiscordProto::CDiscordProto(const char *proto_name, const wchar_t *username) : dbEventType.eventIcon = g_plugin.getIconHandle(IDI_VOICE_ENDED); DbEvent_RegisterType(&dbEventType); + // Groupchat initialization + GCREGISTER gcr = {}; + gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; + gcr.ptszDispName = m_tszUserName; + gcr.pszModule = m_szModuleName; + Chat_Register(&gcr); + // Network initialization CMStringW descr; NETLIBUSER nlu = {}; @@ -145,12 +152,6 @@ void CDiscordProto::OnModulesLoaded() else pNew->channelId = getId(hContact, DB_KEY_CHANNELID); } - GCREGISTER gcr = {}; - gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; - gcr.ptszDispName = m_tszUserName; - gcr.pszModule = m_szModuleName; - Chat_Register(&gcr); - // Clist Clist_GroupCreate(0, m_wszDefaultGroup); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 7f720bac33..5d94dad46c 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -78,6 +78,7 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) : if (pluginVersion < pluginInfoEx.version)
cleanuplastplugin(pluginVersion);
+ gc_init();
links_instance_init();
initavatarrequestthread();
}
@@ -657,7 +658,6 @@ void GaduProto::OnModulesLoaded() // Init misc stuff
gg_icolib_init();
initpopups();
- gc_init();
keepalive_init();
img_init();
block_init();
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 51ce62d926..6eac366e71 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -32,7 +32,7 @@ int GaduProto::gc_init() {
char service[64];
- // Register Gadu-Gadu proto
+ // Register Gadu-Gadu groupchats
GCREGISTER gcr = {};
gcr.ptszDispName = m_tszUserName;
gcr.pszModule = m_szModuleName;
diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 615dbfd8f5..2925a4953c 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -79,6 +79,13 @@ CIcqProto::CIcqProto(const char *aProtoName, const wchar_t *aUserName) : HookProtoEvent(ME_GC_BUILDMENU, &CIcqProto::GroupchatMenuHook); HookProtoEvent(ME_OPT_INITIALISE, &CIcqProto::OnOptionsInit); + // group chats + GCREGISTER gcr = {}; + gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; + gcr.ptszDispName = m_tszUserName; + gcr.pszModule = m_szModuleName; + Chat_Register(&gcr); + // netlib handle CMStringW descr(FORMAT, TranslateT("%s server connection"), m_tszUserName); @@ -122,12 +129,6 @@ CIcqProto::~CIcqProto() void CIcqProto::OnModulesLoaded() { - GCREGISTER gcr = {}; - gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR; - gcr.ptszDispName = m_tszUserName; - gcr.pszModule = m_szModuleName; - Chat_Register(&gcr); - HookProtoEvent(ME_USERINFO_INITIALISE, &CIcqProto::OnUserInfoInit); } diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 97c81d76b6..94afd00dd6 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -71,6 +71,16 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) : CList_SetAllOffline(true);
+ // group chats
+ GCREGISTER gcr = {};
+ gcr.dwFlags = GC_CHANMGR | GC_BOLD | GC_ITALICS | GC_UNDERLINE | GC_COLOR | GC_BKGCOLOR;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.pszModule = m_szModuleName;
+ Chat_Register(&gcr);
+
+ HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook);
+
IRC_MAP_ENTRY("PING", PING)
IRC_MAP_ENTRY("JOIN", JOIN)
IRC_MAP_ENTRY("QUIT", QUIT)
@@ -195,15 +205,6 @@ void CIrcProto::OnModulesLoaded() nlu.szDescriptiveName.w = name;
hNetlibDCC = Netlib_RegisterUser(&nlu);
- GCREGISTER gcr = {};
- gcr.dwFlags = GC_CHANMGR | GC_BOLD | GC_ITALICS | GC_UNDERLINE | GC_COLOR | GC_BKGCOLOR;
- gcr.ptszDispName = m_tszUserName;
- gcr.pszModule = m_szModuleName;
- Chat_Register(&gcr);
-
- HookProtoEvent(ME_GC_EVENT, &CIrcProto::GCEventHook);
- HookProtoEvent(ME_GC_BUILDMENU, &CIrcProto::GCMenuHook);
-
m_pServer = Chat_NewSession(GCW_SERVER, m_szModuleName, SERVERWINDOW, _A2T(m_network));
if (m_useServer && !m_hideServerWindow)
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 685f39eb14..27b02bbf34 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -209,6 +209,17 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) : OmemoInitDevice();
}
+ // group chats
+ GCREGISTER gcr = {};
+ gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.pszModule = m_szModuleName;
+ Chat_Register(&gcr);
+
+ HookProtoEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
+ HookProtoEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
+
+ // resident settings
db_set_resident(m_szModuleName, DBSETTING_XSTATUSID);
db_set_resident(m_szModuleName, DBSETTING_XSTATUSNAME);
db_set_resident(m_szModuleName, DBSETTING_XSTATUSMSG);
@@ -274,15 +285,6 @@ void CJabberProto::OnModulesLoaded() ConsoleInit();
InitInfoFrame();
- GCREGISTER gcr = {};
- gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
- gcr.ptszDispName = m_tszUserName;
- gcr.pszModule = m_szModuleName;
- Chat_Register(&gcr);
-
- HookProtoEvent(ME_GC_EVENT, &CJabberProto::JabberGcEventHook);
- HookProtoEvent(ME_GC_BUILDMENU, &CJabberProto::JabberGcMenuHook);
-
StatusIconData sid = {};
sid.szModule = m_szModuleName;
sid.hIcon = IcoLib_GetIconByHandle(m_hProtoIcon);
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp index f685b3c98d..ee936a7b46 100644 --- a/protocols/MinecraftDynmap/src/proto.cpp +++ b/protocols/MinecraftDynmap/src/proto.cpp @@ -55,6 +55,13 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const wchar_t MessageBox(nullptr, error, L"Miranda NG", MB_OK | MB_ICONERROR); } + // Register group chat + GCREGISTER gcr = {}; + gcr.pszModule = m_szModuleName; + gcr.ptszDispName = m_tszUserName; + gcr.iMaxText = MINECRAFTDYNMAP_MESSAGE_LIMIT; + Chat_Register(&gcr); + // Client instantiation this->error_count_ = 0; this->chatHandle_ = nullptr; @@ -135,16 +142,6 @@ INT_PTR MinecraftDynmapProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) return (INT_PTR)CreateDialogParam(g_plugin.getInst(),MAKEINTRESOURCE(IDD_MinecraftDynmapACCOUNT), (HWND)lParam, MinecraftDynmapAccountProc, (LPARAM)this); } -void MinecraftDynmapProto::OnModulesLoaded() -{ - // Register group chat - GCREGISTER gcr = {}; - gcr.pszModule = m_szModuleName; - gcr.ptszDispName = m_tszUserName; - gcr.iMaxText = MINECRAFTDYNMAP_MESSAGE_LIMIT; - Chat_Register(&gcr); -} - void MinecraftDynmapProto::OnShutdown() { SetStatus(ID_STATUS_OFFLINE); diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h index 9243205886..30bd052680 100644 --- a/protocols/MinecraftDynmap/src/proto.h +++ b/protocols/MinecraftDynmap/src/proto.h @@ -47,7 +47,6 @@ public: int SetStatus(int iNewStatus) override; void OnContactDeleted(MCONTACT) override; - void OnModulesLoaded() override; void OnShutdown() override; // Services diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 1ea0e17332..eee9e19127 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -61,6 +61,14 @@ OmegleProto::OmegleProto(const char* proto_name, const wchar_t* username) : g_plugin.addSound("StrangerTypStop", m_tszUserName, LPGENW("Stranger stopped typing"));
g_plugin.addSound("StrangerChange", m_tszUserName, LPGENW("Changing stranger"));
g_plugin.addSound("StrangerMessage", m_tszUserName, LPGENW("Receive message"));
+
+ // Register group chat
+ GCREGISTER gcr = {};
+ gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG;
+ gcr.pszModule = m_szModuleName;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.iMaxText = OMEGLE_MESSAGE_LIMIT;
+ Chat_Register(&gcr);
}
OmegleProto::~OmegleProto()
@@ -136,17 +144,6 @@ INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, OmegleAccountProc, (LPARAM)this);
}
-void OmegleProto::OnModulesLoaded()
-{
- // Register group chat
- GCREGISTER gcr = {};
- gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG;
- gcr.pszModule = m_szModuleName;
- gcr.ptszDispName = m_tszUserName;
- gcr.iMaxText = OMEGLE_MESSAGE_LIMIT;
- Chat_Register(&gcr);
-}
-
void OmegleProto::OnShutdown()
{
SetStatus(ID_STATUS_OFFLINE);
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index b84d023247..fe84b61698 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -52,7 +52,6 @@ public: int UserIsTyping(MCONTACT hContact, int type) override;
void OnContactDeleted(MCONTACT) override;
- void OnModulesLoaded() override;
void OnShutdown() override;
// Services
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 186ebcda7f..fb84cb050a 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -69,8 +69,7 @@ INT_PTR CSametimeProto::SametimeLoadIcon(WPARAM wParam, LPARAM lParam) GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
}
-
-//icolib stuff
+// icolib stuff
static IconItem iconList[] =
{
{ LPGEN("Protocol icon"), "protoicon", IDI_ICON_PROTO, 0 },
@@ -123,16 +122,6 @@ int CSametimeProto::OnIdleChanged(WPARAM, LPARAM lParam) return 0;
}
-void CSametimeProto::OnModulesLoaded()
-{
- // register with chat module
- GCREGISTER gcr = {};
- gcr.pszModule = m_szModuleName;
- gcr.ptszDispName = m_tszUserName;
- gcr.iMaxText = MAX_MESSAGE_SIZE;
- Chat_Register(&gcr);
-}
-
void CSametimeProto::OnShutdown()
{
if (m_iStatus != ID_STATUS_OFFLINE)
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 7f583c3e1d..594c9d9874 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -55,6 +55,13 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN LoadOptions();
+ // register with chat module
+ GCREGISTER gcr = {};
+ gcr.pszModule = m_szModuleName;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.iMaxText = MAX_MESSAGE_SIZE;
+ Chat_Register(&gcr);
+
debugLogW(L"CSametimeProto::CSametimeProto() end");
}
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index b97a53c40f..2f1cf45750 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -38,7 +38,6 @@ struct CSametimeProto : public PROTO<CSametimeProto> int UserIsTyping(MCONTACT hContact, int type) override;
- void OnModulesLoaded() override;
void OnShutdown() override;
// sametime.cpp
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 3a423559ef..9547c455fc 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -51,6 +51,8 @@ CSkypeProto::CSkypeProto(const char* protoName, const wchar_t* userName) : g_plugin.addSound("skype_call_canceled", L"SkypeWeb", LPGENW("Incoming call canceled")); m_hPollingThread = ForkThreadEx(&CSkypeProto::PollingThread, NULL, NULL); + + InitGroupChatModule(); } CSkypeProto::~CSkypeProto() @@ -77,7 +79,6 @@ void CSkypeProto::OnModulesLoaded() InitDBEvents(); InitPopups(); - InitGroupChatModule(); } void CSkypeProto::OnShutdown() diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 45746bc813..ec930e16c8 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -69,6 +69,13 @@ CTwitterProto::CTwitterProto(const char *proto_name, const wchar_t *username) : MessageBox(nullptr, error, L"Miranda NG", MB_OK | MB_ICONERROR);
}
+ // register group chats
+ GCREGISTER gcr = {};
+ gcr.pszModule = m_szModuleName;
+ gcr.ptszDispName = m_tszUserName;
+ gcr.iMaxText = 159;
+ Chat_Register(&gcr);
+
// Create avatar network connection (TODO: probably remove this)
char module[512];
mir_snprintf(module, "%sAv", m_szModuleName);
@@ -259,12 +266,6 @@ INT_PTR CTwitterProto::OnTweet(WPARAM, LPARAM) void CTwitterProto::OnModulesLoaded()
{
- GCREGISTER gcr = {};
- gcr.pszModule = m_szModuleName;
- gcr.ptszDispName = m_tszUserName;
- gcr.iMaxText = 159;
- Chat_Register(&gcr);
-
DBEVENTTYPEDESCR evt = {};
evt.eventType = TWITTER_DB_EVENT_TYPE_TWEET;
evt.module = m_szModuleName;
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 6de717c1d6..80c57a1b52 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -71,6 +71,17 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) : // Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
+
+ // Group chats
+ GCREGISTER gcr = {};
+ gcr.ptszDispName = m_tszUserName;
+ gcr.pszModule = m_szModuleName;
+ Chat_Register(&gcr);
+
+ CreateProtoService(PS_LEAVECHAT, &CVkProto::OnLeaveChat);
+ CreateProtoService(PS_JOINCHAT, &CVkProto::OnJoinChat);
+ HookProtoEvent(ME_GC_EVENT, &CVkProto::OnChatEvent);
+ HookProtoEvent(ME_GC_BUILDMENU, &CVkProto::OnGcMenuHook);
}
CVkProto::~CVkProto()
@@ -88,17 +99,6 @@ void CVkProto::OnModulesLoaded() {
Clist_GroupCreate(0, m_vkOptions.pwszDefaultGroup);
- // Chats
- GCREGISTER gcr = {};
- gcr.ptszDispName = m_tszUserName;
- gcr.pszModule = m_szModuleName;
- Chat_Register(&gcr);
-
- CreateProtoService(PS_LEAVECHAT, &CVkProto::OnLeaveChat);
- CreateProtoService(PS_JOINCHAT, &CVkProto::OnJoinChat);
- HookProtoEvent(ME_GC_EVENT, &CVkProto::OnChatEvent);
- HookProtoEvent(ME_GC_BUILDMENU, &CVkProto::OnGcMenuHook);
-
// Other hooks
HookProtoEvent(ME_MSG_WINDOWEVENT, &CVkProto::OnProcessSrmmEvent);
HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CVkProto::OnDbEventRead);
|