diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-21 17:32:41 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-21 17:32:41 +0300 |
commit | 9f9082d49aaaf924f5d00c634641b3da0d115890 (patch) | |
tree | a659bf5de2115ee5893ad7531e4d85161b7dc708 | |
parent | d3aa476a211b9e9d8ac6f97aa2ae6df05609733c (diff) |
if a protocol receives a message delivery confirmation, it can pass the server id for an event as LPCSTR into lParam of ProtoBroadcastAck
-rw-r--r-- | plugins/Scriver/src/globals.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index f529234937..a878f8a2ae 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -156,7 +156,9 @@ static int ackevent(WPARAM, LPARAM lParam) NotifyEventHooks(g_chatApi.hevPreCreate, 0, (LPARAM)&evt);
item->sendBuffer = (char *)dbei.pBlob;
- db_event_add(hContact, &dbei);
+ MEVENT hNewEvent = db_event_add(hContact, &dbei);
+ if (hNewEvent && pAck->lParam)
+ db_event_setId(dbei.szModule, hNewEvent, (char *)pAck->lParam);
if (item->hwndErrorDlg != nullptr)
DestroyWindow(item->hwndErrorDlg);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index b557416512..f45475448f 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -481,6 +481,8 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam) job.szSendBuffer = (char*)dbei.pBlob; MEVENT hNewEvent = db_event_add(job.hContact, &dbei); + if (hNewEvent && ack->lParam) + db_event_setId(dbei.szModule, hNewEvent, (char*)ack->lParam); if (m_pContainer) if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND)) diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index 8532ae8249..b15cc9b8ef 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -77,14 +77,14 @@ TMsgQueue* msgQueue_find(MCONTACT hContact, int id) return nullptr;
}
-void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *szErr)
+void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *lParam)
{
TMsgQueue *p = msgQueue_find(hContact, id);
if (p == nullptr)
return;
if (!success) {
- MessageFailureProcess(p, szErr);
+ MessageFailureProcess(p, lParam);
return;
}
@@ -97,7 +97,9 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *sz dbei.pBlob = (PBYTE)p->szMsg;
MessageWindowEvent evt = { id, hContact, &dbei };
- NotifyEventHooks(g_chatApi.hevPreCreate, 0, (LPARAM)&evt);
+ MEVENT hNewEvent = NotifyEventHooks(g_chatApi.hevPreCreate, 0, (LPARAM)&evt);
+ if (hNewEvent && lParam)
+ db_event_setId(dbei.szModule, hNewEvent, lParam);
p->szMsg = (char*)dbei.pBlob;
|