diff options
author | George Hazan <ghazan@miranda.im> | 2020-06-15 18:35:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-06-15 18:35:28 +0300 |
commit | 436e303e24e5046d6cc52ac3da51a0b51adbef36 (patch) | |
tree | 4f7d3b27ad24e710dae845558e2d719b54d1d88a /plugins/CmdLine/src | |
parent | f0d86d413859d402331b49b98db7d61fef801489 (diff) |
simpler way of applying server ids to messages
Diffstat (limited to 'plugins/CmdLine/src')
-rw-r--r-- | plugins/CmdLine/src/mimcmd_handlers.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 7427dc3257..d4393eae43 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -702,19 +702,14 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re if (ack->szModule) {
szReply.AppendFormat(TranslateT("Message sent to '%s'."), contact);
- DBEVENTINFO e = {};
- char module[128];
- e.eventType = EVENTTYPE_MESSAGE;
- e.flags = DBEF_SENT | DBEF_UTF;
-
- e.pBlob = (PBYTE)szMessage.get();
- e.cbBlob = (DWORD)mir_strlen(szMessage) + 1;
-
- strncpy_s(module, ack->szModule, _countof(module));
- e.szModule = module;
- e.timestamp = (DWORD)time(0);
-
- db_event_add(ack->hContact, &e);
+ DBEVENTINFO dbei = {};
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ dbei.flags = DBEF_SENT | DBEF_UTF;
+ dbei.pBlob = (PBYTE)szMessage.get();
+ dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1;
+ dbei.szModule = ack->szModule;
+ dbei.timestamp = (DWORD)time(0);
+ db_event_add(ack->hContact, &dbei);
}
else szReply.AppendFormat(TranslateT("Message to '%s' was marked as sent but the account seems to be offline"), contact);
}
|