[Servatrice] Relay room channel messages over ISL (#7480)

* [Servatrice] Relay room channel messages over ISL

* [Servatrice] Skip audit log for unknown ISL channel per review

- externalRoomSay drops messages for channels not in the local
  catalog, matching Server_Room::say, instead of logging what was
  never delivered

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-16 22:46:40 +02:00 • committed by GitHub
parent ce51e7147d
commit 155f7b0143
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 34 additions and 9 deletions

View file

@ -441,7 +441,7 @@ void Server::externalRoomUserLeft(int roomId, const QString &userName)
room->removeExternalUser(userName);
}
void Server::externalRoomSay(int roomId, const QString &userName, const QString &message)
void Server::externalRoomSay(int roomId, const QString &userName, const QString &message, const QString &channelId)
{
// This function is always called from the main thread via signal/slot.
QReadLocker locker(&roomsLock);
@ -451,10 +451,22 @@ void Server::externalRoomSay(int roomId, const QString &userName, const QString
qDebug() << "externalRoomSay: room id=" << roomId << "not found";
return;
}
room->say(userName, message, QString(), false);
if (!channelId.isEmpty() && !Server_Room::isMainChannel(channelId) && room->findChannel(channelId) == nullptr) {
// The receiver does not know this channel; say() would drop it, so do
// not log what was never delivered.
qDebug() << "externalRoomSay: unknown channel" << channelId << "for room id=" << roomId << "dropping";
return;
}
room->say(userName, message, channelId, false);
getDatabaseInterface()->logMessage(0, userName, "ISL", message, Server_DatabaseInterface::MessageTargetIslRoom,
room->getId(), room->getName());
if (channelId.isEmpty()) {
getDatabaseInterface()->logMessage(0, userName, "ISL", message, Server_DatabaseInterface::MessageTargetIslRoom,
room->getId(), room->getName());
} else {
getDatabaseInterface()->logMessage(0, userName, "ISL", message,
Server_DatabaseInterface::MessageTargetRoomChannel, room->getId(),
room->getName(), channelId);
}
}
void Server::externalRoomRemoveMessages(int roomId, const QString &userName, int amount)

View file

@ -265,7 +265,7 @@ protected slots:
void externalUserLeft(const QString &userName);
void externalRoomUserJoined(int roomId, const ServerInfo_User &userInfo);
void externalRoomUserLeft(int roomId, const QString &userName);
void externalRoomSay(int roomId, const QString &userName, const QString &message);
void externalRoomSay(int roomId, const QString &userName, const QString &message, const QString &channelId);
void externalRoomRemoveMessages(int roomId, const QString &userName, int amount);
void externalRoomGameListChanged(int roomId, const ServerInfo_Game &gameInfo);
void