From 8f9292d483fcf3a10d9284512359c4562f5311eb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Apr 2023 17:07:04 +0300 Subject: DB::FILE_BLOB - file events' access unification --- plugins/NewStory/src/history_array.cpp | 4 +++- plugins/NewStory/src/history_array.h | 2 +- plugins/NewStory/src/history_control.cpp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 6b64e08c63..08baac7ff7 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -127,8 +127,10 @@ void ItemData::load(bool bFullLoad) wchar_t buf[MAX_PATH]; CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); { + DB::FILE_BLOB blob(dbe); + CMStringW wszFileName(buf); - wszFileName.Append(ptrW(DbEvent_GetTextW(&dbe, CP_ACP))); + wszFileName.Append(blob.getName()); // if a filename contains spaces, URL will be broken if (wszFileName.Find(' ') != -1) { diff --git a/plugins/NewStory/src/history_array.h b/plugins/NewStory/src/history_array.h index a57b5f42ca..1df5ee2c76 100644 --- a/plugins/NewStory/src/history_array.h +++ b/plugins/NewStory/src/history_array.h @@ -10,7 +10,7 @@ struct ItemData bool bLoaded; int savedTop; - DBEVENTINFO dbe; + DB::EventInfo dbe; wchar_t *wtext; wchar_t *wszNick; diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 398c6b24ab..bcb75402f8 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -179,7 +179,7 @@ struct NewstoryListData : public MZeroedObject 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->hContact, pItem->hEvent, &pItem->dbe); + db_event_edit(pItem->hEvent, &pItem->dbe); if (auto *ppro = Proto_GetInstance(pItem->hContact)) ppro->OnEventEdited(pItem->hContact, pItem->hEvent); -- cgit v1.2.3