diff options
author | George Hazan <george.hazan@gmail.com> | 2023-09-06 15:14:07 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-09-06 15:14:07 +0300 |
commit | 38b24044db30c606e9bb3ebe0849b16c9fdc6e62 (patch) | |
tree | af2822805df50b5f3cc18abc2d709ace3140342d /plugins | |
parent | 5e232971e1eb3a0ce665a3e34b982db49676e653 (diff) |
fixes #3667 (Telegram: add message edit feature)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 2 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 1206b30b09..d8f5bc242e 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -291,7 +291,7 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei) lock.unlock();
DBFlush();
- NotifyEventHooks(g_hevEventEdited, 0, hDbEvent);
+ NotifyEventHooks(g_hevEventEdited, GetEventContact(hDbEvent), hDbEvent);
return 0;
}
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index ed4df6fd3f..bc48e35777 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -335,17 +335,16 @@ void NewstoryListData::EndEditItem(bool bAccept) int iTextLen = GetWindowTextLengthW(hwndEditBox); replaceStrW(pItem->wtext, (wchar_t *)mir_alloc((iTextLen + 1) * sizeof(wchar_t))); - GetWindowTextW(hwndEditBox, pItem->wtext, iTextLen); + GetWindowTextW(hwndEditBox, pItem->wtext, iTextLen+1); pItem->wtext[iTextLen] = 0; if (pItem->hContact && pItem->hEvent) { - ptrA szUtf(mir_utf8encodeW(pItem->wtext)); - pItem->dbe.cbBlob = (int)mir_strlen(szUtf) + 1; - pItem->dbe.pBlob = (uint8_t *)szUtf.get(); - db_event_edit(pItem->hEvent, &pItem->dbe); + DBEVENTINFO dbei = pItem->dbe; - if (auto *ppro = Proto_GetInstance(pItem->hContact)) - ppro->OnEventEdited(pItem->hContact, pItem->hEvent); + ptrA szUtf(mir_utf8encodeW(pItem->wtext)); + dbei.cbBlob = (int)mir_strlen(szUtf) + 1; + dbei.pBlob = (uint8_t *)szUtf.get(); + db_event_edit(pItem->hEvent, &dbei); } MTextDestroy(pItem->data); pItem->data = 0; |