2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

preparing new dev version, date tooltip on timestamp hover, year marks in old day labels, new auth code / sms algo

This commit is contained in:
John Preston
2015-08-31 17:27:20 +03:00
parent 84436a34b0
commit d840ec37db
12 changed files with 214 additions and 30 deletions

View File

@@ -542,7 +542,27 @@ public:
flags(0),
lnkIndex(0),
stopAfterWidth(QFIXED_MAX) {
lnkRanges = links;
if ((options.flags & TextParseLinks) && !links.isEmpty()) {
bool parseMentions = (options.flags & TextParseMentions);
bool parseHashtags = (options.flags & TextParseHashtags);
bool parseBotCommands = (options.flags & TextParseBotCommands);
if (parseMentions && parseHashtags && parseBotCommands) {
lnkRanges = links;
} else {
int32 i = 0, l = links.size();
lnkRanges.reserve(l);
const QChar *p = text.constData(), s = text.size();
for (; i < l; ++i) {
LinkInTextType t = links.at(i).type;
if ((t == LinkInTextMention && !parseMentions) ||
(t == LinkInTextHashtag && !parseHashtags) ||
(t == LinkInTextBotCommand && !parseBotCommands)) {
continue;
}
lnkRanges.push_back(links.at(i));
}
}
}
parse(options);
}
void parse(const TextParseOptions &options) {