summaryrefslogtreecommitdiff
path: root/plugins/MirOTR
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-26 23:34:30 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-26 23:34:30 +0300
commitab3d423b1dc514e9db61c170ca14bab49e5280cb (patch)
treef8c76c7b8cb5ad8804aff7222960126e9180d66c /plugins/MirOTR
parent395ecbc7e8f02c0ea659a598e5f9bab8995f3451 (diff)
major atavism, PROTORECVEVENT, died with its own set of constants
Diffstat (limited to 'plugins/MirOTR')
-rw-r--r--plugins/MirOTR/src/svcs_proto.cpp16
-rw-r--r--plugins/MirOTR/src/utils.cpp20
2 files changed, 18 insertions, 18 deletions
diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp
index 038500363b..38f1bb401c 100644
--- a/plugins/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/src/svcs_proto.cpp
@@ -76,13 +76,13 @@ INT_PTR SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
{
CCSDATA *ccs = (CCSDATA *) lParam;
- PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
+ auto *dbei = (DB::EventInfo *) ccs->lParam;
DEBUGOUTA("OTR - receiving message: '");
- DEBUGOUTA(pre->szMessage);
+ DEBUGOUTA(dbei->pBlob);
DEBUGOUTA("'\n");
- if (pre->flags & PREF_BYPASS_OTR) // bypass for our inline messages
+ if (dbei->flags & PREF_BYPASS_OTR) // bypass for our inline messages
return Proto_ChainRecv(wParam, ccs);
char *proto = Proto_GetBaseAccountName(ccs->hContact);
@@ -91,7 +91,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
else if(proto && mir_strcmp(proto, META_PROTO) == 0) // bypass for metacontacts
return Proto_ChainRecv(wParam, ccs);
- char *oldmessage = pre->szMessage;
+ char *oldmessage = dbei->pBlob;
// convert oldmessage to utf-8
if (!oldmessage)
return 1;
@@ -125,7 +125,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
if (newmessage == nullptr)
return Proto_ChainRecv(wParam, ccs);
- uint32_t oldflags = pre->flags;
+ uint32_t oldflags = dbei->flags;
typedef void (*msg_free_t)(void*);
msg_free_t msg_free = (msg_free_t)otrl_message_free;
@@ -142,11 +142,11 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
replaceStr(newmessage, tmp.Detach());
msg_free = mir_free;
}
- pre->szMessage = newmessage;
+ dbei->pBlob = newmessage;
BOOL ret = Proto_ChainRecv(wParam, ccs);
/// @todo (White-Tiger#1#03/23/15): why are we doing this?
- pre->flags = oldflags;
- pre->szMessage = oldmessage;
+ dbei->flags = oldflags;
+ dbei->pBlob = oldmessage;
msg_free(newmessage);
return ret;
}
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index 76b4d03c96..af6c8eb928 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -215,11 +215,11 @@ void ShowMessageInline(const MCONTACT hContact, const wchar_t *msg)
mir_snwprintf(buff, L"%s%s", _A2W(LANG_INLINE_PREFIX), msg);
T2Utf utf(buff);
- PROTORECVEVENT pre = { 0 };
- pre.timestamp = time(0);
- pre.szMessage = utf;
- pre.flags = PREF_BYPASS_OTR;
- ProtoChainRecvMsg(hContact, &pre);
+ DB::EventInfo dbei;
+ dbei.timestamp = time(0);
+ dbei.pBlob = utf;
+ dbei.flags = PREF_BYPASS_OTR;
+ ProtoChainRecvMsg(hContact, dbei);
}
void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg)
@@ -227,11 +227,11 @@ void ShowMessageInlineUtf(const MCONTACT hContact, const char *msg)
char buff[1024];
mir_snprintf(buff, "%s%s", LANG_INLINE_PREFIX, msg);
- PROTORECVEVENT pre = { 0 };
- pre.timestamp = time(0);
- pre.szMessage = buff;
- pre.flags = PREF_BYPASS_OTR;
- ProtoChainRecvMsg(hContact, &pre);
+ DB::EventInfo dbei;
+ dbei.timestamp = time(0);
+ dbei.pBlob = buff;
+ dbei.flags = PREF_BYPASS_OTR;
+ ProtoChainRecvMsg(hContact, dbei);
}
void ShowMessageUtf(const MCONTACT hContact, const char *msg)