Reject group avatar commands outside a running chat service

This commit is contained in:
evgeny committed 2026-10-06 13:59:17 +02:00
1 parent b6a5f98d41
commit 2bcba58131
2 files changed
+8 -3

No files matched your search

@@ -62,7 +62,10 @@ QImage GroupAvatarManager::image(const QString& channel, quint64 version, const
}
void GroupAvatarManager::upload(const QString& channel, const QString& source) {
if (!gui_bridge_is_uasync_ready()) { emit status(channel, text("Chat is stopped")); return; }
if (!gui_bridge_is_uasync_ready()) {
DEBUG_WARN(DEBUG_CATEGORY_CHAT, "group avatar: upload requested while chat is stopped channel=%s", qPrintable(channel));
emit status(channel, text("Chat is stopped")); return;
}
quint64 generation = ++m_generation[channel]; emit status(channel, text("Preparing group avatar…"));
m_pool.start(QRunnable::create([this, channel, source, generation] {
QImageReader reader(source); reader.setAutoTransform(true); QImage image; QByteArray encoded; QString error;