summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-11-19 22:42:08 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-11-19 22:42:08 +0300
commitac6f11abaab51b48d7e60c7037915f97881387b0 (patch)
tree823f56c0a670c25f9c8160fe6069d4ec229ff856 /protocols
parent11a28a886672e2e96dcddefd9fae2622ab5b965c (diff)
Discord: fix for new auth dialog
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Discord/src/proto.cpp19
-rw-r--r--protocols/Discord/src/proto.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index e5a62df682..d0f982fbd7 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -436,6 +436,25 @@ MCONTACT CDiscordProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
return hContact;
}
+MCONTACT CDiscordProto::AddToListByEvent(int flags, int, MEVENT hDbEvent)
+{
+ DB::EventInfo dbei;
+ dbei.cbBlob = -1;
+ if (db_event_get(hDbEvent, &dbei))
+ return 0;
+ if (mir_strcmp(dbei.szModule, m_szModuleName))
+ return 0;
+ if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
+ return 0;
+
+ DB::AUTH_BLOB blob(dbei.pBlob);
+ if (flags & PALF_TEMPORARY)
+ Contact_RemoveFromList(blob.get_contact());
+ else
+ Contact_PutOnList(blob.get_contact());
+ return blob.get_contact();
+}
+
////////////////////////////////////////////////////////////////////////////////////////
// SendMsg
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index c90aafba6a..8a4301fcad 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -356,6 +356,7 @@ public:
HANDLE SearchBasic(const wchar_t *id) override;
MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
+ MCONTACT AddToListByEvent(int flags, int, MEVENT hDbEvent) override;
int AuthRecv(MCONTACT, PROTORECVEVENT *pre) override;
int Authorize(MEVENT hDbEvent) override;