Limit status messages to 255 bytes

pull/1825/head
Nicolas Werner 1 month ago
parent 048af42780
commit db68281a28
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 10
      src/timeline/PresenceEmitter.cpp

@ -37,8 +37,14 @@ static CacheEntry *
pullPresence(const QString &id)
{
auto p = cache::presence(id.toStdString());
auto c = new CacheEntry{
utils::replaceEmoji(QString::fromStdString(p.status_msg).toHtmlEscaped()), p.presence};
auto statusMsg = QString::fromStdString(p.status_msg);
if (statusMsg.size() > 255) {
statusMsg.truncate(255);
statusMsg.append(u'');
}
auto c = new CacheEntry{utils::replaceEmoji(std::move(statusMsg).toHtmlEscaped()), p.presence};
presences.insert(id, c);
return c;
}

Loading…
Cancel
Save