2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

serverside links parsing used

This commit is contained in:
John Preston
2015-08-24 13:53:04 +03:00
parent 8dff205949
commit 4afa1aace0
8 changed files with 345 additions and 151 deletions

View File

@@ -79,6 +79,9 @@ namespace {
typedef QMap<uint64, MsgId> RandomData;
RandomData randomData;
typedef QMap<uint64, QString> SentTextData;
SentTextData sentTextData;
HistoryItem *hoveredItem = 0, *pressedItem = 0, *hoveredLinkItem = 0, *pressedLinkItem = 0, *contextItem = 0, *mousedItem = 0;
QPixmap *sprite = 0, *emojis = 0, *emojisLarge = 0;
@@ -1681,6 +1684,7 @@ namespace App {
void historyClearItems() {
historyClearMsgs();
randomData.clear();
sentTextData.clear();
mutedPeers.clear();
updatedPeers.clear();
cSetSavedPeers(SavedPeers());
@@ -1756,6 +1760,18 @@ namespace App {
return 0;
}
void historyRegSentText(uint64 randomId, const QString &text) {
sentTextData.insert(randomId, text);
}
void historyUnregSentText(uint64 randomId) {
sentTextData.remove(randomId);
}
QString histSentTextByItem(uint64 randomId) {
return sentTextData.value(randomId);
}
void prepareCorners(RoundCorners index, int32 radius, const style::color &color, const style::color *shadow = 0, QImage *cors = 0) {
int32 r = radius * cIntRetinaFactor(), s = st::msgShadow * cIntRetinaFactor();
QImage rect(r * 3, r * 3 + (shadow ? s : 0), QImage::Format_ARGB32_Premultiplied), localCors[4];