diff options
-rw-r--r-- | include/m_database.h | 1 | ||||
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 1 | ||||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 12 | ||||
-rw-r--r-- | protocols/Telegram/src/server.cpp | 6 |
4 files changed, 17 insertions, 3 deletions
diff --git a/include/m_database.h b/include/m_database.h index 3a1393d2d4..1fc5614a0e 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -208,6 +208,7 @@ struct DBEVENTINFO bool isBookmark : 1; // event is bookmarked
bool isJson : 1; // event's body is a JSON structure
bool bMsec : 1; // event's timestamp is in milliseconds
+ bool bEdited : 1; // event was edited
};
};
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 814e6428c6..0b934a3e48 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -285,6 +285,7 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei) if (tmp.bSent)
tmp.bRead = true;
+ tmp.bEdited = true;
mir_cslockfull lock(m_csDbAccess);
sqlite3_stmt *stmt;
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index ee3ba8daec..bea9d73618 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -805,7 +805,7 @@ void NewstoryListData::Paint(simpledib::dib &dib) if (g_plugin.bShowType) {
switch (pItem->dbe.eventType) {
case EVENTTYPE_MESSAGE:
- hIcon = g_plugin.getIcon(IDI_SENDMSG);
+ hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
break;
case EVENTTYPE_FILE:
hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
@@ -819,6 +819,7 @@ void NewstoryListData::Paint(simpledib::dib &dib) }
DrawIconEx(dib, xPos, yPos, hIcon, 16, 16, 0, 0, DI_NORMAL);
xPos += 18;
+ IcoLib_ReleaseIcon(hIcon);
}
// Direction icon
@@ -829,10 +830,11 @@ void NewstoryListData::Paint(simpledib::dib &dib) hIcon = g_plugin.getIcon(IDI_MSGIN);
DrawIconEx(dib, xPos, yPos, hIcon, 16, 16, 0, 0, DI_NORMAL);
xPos += 18;
+ IcoLib_ReleaseIcon(hIcon);
}
// Bookmark icon
- if (pItem->dbe.flags & DBEF_BOOKMARK) {
+ if (pItem->dbe.isBookmark) {
DrawIconEx(dib, xPos, yPos, g_plugin.getIcon(IDI_BOOKMARK), 16, 16, 0, 0, DI_NORMAL);
xPos += 18;
}
@@ -850,6 +852,12 @@ void NewstoryListData::Paint(simpledib::dib &dib) DrawIconEx(dib, cachedWindowWidth - (xRight = 20), yPos, g_plugin.getIcon(IDI_REMOTEREAD), 16, 16, 0, 0, DI_NORMAL);
else if (pItem->m_bDelivered)
DrawIconEx(dib, cachedWindowWidth - (xRight = 20), yPos, g_plugin.getIcon(IDI_DELIVERED), 16, 16, 0, 0, DI_NORMAL);
+
+ // Edited icon
+ if (pItem->dbe.bEdited) {
+ xRight += 20;
+ DrawIconEx(dib, cachedWindowWidth - xRight, yPos, g_plugin.getIcon(IDI_SENDMSG), 16, 16, 0, 0, DI_NORMAL);
+ }
}
// draw html itself
diff --git a/protocols/Telegram/src/server.cpp b/protocols/Telegram/src/server.cpp index 9ecd5ff29a..0c144c1e6f 100644 --- a/protocols/Telegram/src/server.cpp +++ b/protocols/Telegram/src/server.cpp @@ -483,7 +483,9 @@ void CTelegramProto::OnGetHistory(td::ClientManager::Response &response, void *p dbei.cbBlob = szBody.GetLength();
dbei.pBlob = szBody.GetBuffer();
dbei.szId = szMsgId;
- dbei.flags = DBEF_READ | DBEF_UTF;
+ dbei.bRead = dbei.bUtf = true;
+ if (pMsg->edit_date_)
+ dbei.bEdited = true;
if (pMsg->is_outgoing_)
dbei.flags |= DBEF_SENT;
if (this->GetGcUserId(pUser, pMsg, szUserId))
@@ -997,6 +999,8 @@ void CTelegramProto::ProcessMessage(const TD::message *pMessage) dbei.bSent = dbei.bRead = true;
else if (pMessage->id_ <= pUser->lastReadId)
dbei.bRead = true;
+ if (pMessage->edit_date_)
+ dbei.bEdited = true;
if (!pUser->bInited)
dbei.bRead = true;
if (GetGcUserId(pUser, pMessage, szUserId))
|