summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
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 /protocols/Discord/src
parent395ecbc7e8f02c0ea659a598e5f9bab8995f3451 (diff)
major atavism, PROTORECVEVENT, died with its own set of constants
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/dispatch.cpp14
-rw-r--r--protocols/Discord/src/proto.cpp4
-rw-r--r--protocols/Discord/src/proto.h2
-rw-r--r--protocols/Discord/src/utils.cpp10
4 files changed, 15 insertions, 15 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index 536eff688f..0c6062f1d5 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -408,23 +408,23 @@ void CDiscordProto::OnCommandMessage(const JSONNode &pRoot, bool bIsNew)
wszText.AppendFormat(L" (%s %s)", TranslateT("edited at"), edited.as_mstring().c_str());
// if a message has myself as an author, add some flags
- PROTORECVEVENT recv = {};
+ DB::EventInfo dbei;
if (bOurMessage)
- recv.flags = PREF_CREATEREAD | PREF_SENT;
+ dbei.flags = DBEF_READ | DBEF_SENT;
debugLogA("store a message from private user %lld, channel id %lld", pUser->id, pUser->channelId);
ptrA buf(mir_utf8encodeW(wszText));
- recv.timestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
- recv.szMessage = buf;
- recv.szMsgId = szMsgId;
+ dbei.timestamp = (uint32_t)StringToDate(pRoot["timestamp"].as_mstring());
+ dbei.pBlob = buf;
+ dbei.szId = szMsgId;
if (!pUser->bIsPrivate || pUser->bIsGroup) {
- recv.szUserId = szUserId;
+ dbei.szUserId = szUserId;
ProcessChatUser(pUser, userId, pRoot);
}
- ProtoChainRecvMsg(pUser->hContact, &recv);
+ ProtoChainRecvMsg(pUser->hContact, dbei);
}
pUser->lastMsgId = msgId;
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index e2f0658819..00c7daf351 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -369,9 +369,9 @@ int CDiscordProto::AuthRequest(MCONTACT hContact, const wchar_t*)
return 0;
}
-int CDiscordProto::AuthRecv(MCONTACT, PROTORECVEVENT *pre)
+int CDiscordProto::AuthRecv(MCONTACT, DB::EventInfo &dbei)
{
- return Proto_AuthRecv(m_szModuleName, pre);
+ return Proto_AuthRecv(m_szModuleName, dbei);
}
int CDiscordProto::Authorize(MEVENT hDbEvent)
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index 1bc7c04444..4c9f74e181 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -427,7 +427,7 @@ public:
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
MCONTACT AddToListByEvent(int flags, int, MEVENT hDbEvent) override;
- int AuthRecv(MCONTACT, PROTORECVEVENT *pre) override;
+ int AuthRecv(MCONTACT, DB::EventInfo &dbei) override;
int Authorize(MEVENT hDbEvent) override;
int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override;
int AuthRequest(MCONTACT hContact, const wchar_t*) override;
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index cc2e4fff3a..dcd94ebe71 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -334,11 +334,11 @@ void CDiscordProto::ProcessType(CDiscordUser *pUser, const JSONNode &pRoot)
CMStringA szId(FORMAT, "%lld", pUser->id);
DB::AUTH_BLOB blob(pUser->hContact, T2Utf(pUser->wszUsername), nullptr, nullptr, szId, nullptr);
- PROTORECVEVENT pre = {};
- pre.timestamp = (uint32_t)time(0);
- pre.lParam = blob.size();
- pre.szMessage = blob;
- ProtoChainRecv(pUser->hContact, PSR_AUTH, 0, (LPARAM)&pre);
+ DB::EventInfo dbei;
+ dbei.timestamp = (uint32_t)time(0);
+ dbei.cbBlob = blob.size();
+ dbei.pBlob = blob;
+ ProtoChainRecv(pUser->hContact, PSR_AUTH, 0, (LPARAM)&dbei);
}
break;
}