diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-10-11 08:42:39 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-10-11 08:42:39 +0000 |
commit | 283b4ae7cb3ca185b9a9eb1e629b9f7278be55de (patch) | |
tree | 00594b091ea9e0ede85ee57bc7e425b77837597f /otr/dllmain.cpp | |
parent | 2858844b5063f5f2a753f162d0fa475bae4a48b0 (diff) |
more fixes for hard-coded metacontact protocol name
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@365 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r-- | otr/dllmain.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp index 24f41ea..f4f13b7 100644 --- a/otr/dllmain.cpp +++ b/otr/dllmain.cpp @@ -34,6 +34,8 @@ OtrlUserState otr_user_state = 0; UINT_PTR TIMER_ID_CLEAR_FINISHED = 0;
+char *metaproto = 0;
+
// plugin stuff
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -652,7 +654,7 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){ //MessageBox(0, (char *)ccs->lParam, "OTR - sending raw message", MB_OK);
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(proto && strcmp(proto, "MetaContacts") == 0) // bypass for metacontacts
+ if(proto && metaproto && strcmp(proto, metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
if(!proto) return 1; // error
@@ -830,7 +832,7 @@ int RecvMessage(WPARAM wParam,LPARAM lParam){ OtrlTLV *tlv = 0;
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(proto && strcmp(proto, "MetaContacts") == 0) // bypass for metacontacts
+ if(proto && metaproto && strcmp(proto, metaproto) == 0) // bypass for metacontacts
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
if(strlen(oldmessage) > INLINE_PREFIX_LEN && strncmp(oldmessage, INLINE_PREFIX, INLINE_PREFIX_LEN) == 0) // bypass for our inline messages
@@ -1013,7 +1015,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) { return 0;
}
- if(ServiceExists(MS_MC_GETPROTOCOLNAME) && strcmp(proto, (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0)) == 0) {
+ if(metaproto && strcmp(proto, metaproto) == 0) {
HANDLE hSubContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
if(!hSubContact)
return 0;
@@ -1245,6 +1247,9 @@ void ReadPrivkeyFiles() { }
int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
+ if(ServiceExists(MS_MC_GETPROTOCOLNAME))
+ metaproto = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
+
if(ServiceExists(MS_UPDATE_REGISTER)) {
// register with updater
Update update = {0};
|