mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-18 10:42:49 +00:00
feat(dashboard): reading whispers is its own permission
chat_dms (GM 8) reads whispers; chat_private is now team and guild chat only. Adds chat_flag and chat_flag_review (GM 3). Both can be granted per account or character with the permission grants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -216,6 +216,8 @@ namespace {
|
||||
query.characterId = character;
|
||||
query.since = center - window;
|
||||
query.includePrivate = Can(context, "chat_private");
|
||||
query.includeWhispers = Can(context, "chat_dms");
|
||||
query.includeWhispers = Can(context, "chat_dms");
|
||||
query.limit = 200;
|
||||
for (auto& m : Database::Get()->GetChatMessages(query)) {
|
||||
if (m.time <= center + window) found[m.id] = std::move(m);
|
||||
@@ -317,6 +319,7 @@ namespace {
|
||||
query.afterId = id - 1;
|
||||
query.limit = 1;
|
||||
query.includePrivate = Can(context, "chat_private");
|
||||
query.includeWhispers = Can(context, "chat_dms");
|
||||
const auto found = Database::Get()->GetChatMessages(query);
|
||||
if (found.empty() || found.front().id != id) return std::nullopt;
|
||||
return found.front();
|
||||
@@ -354,6 +357,7 @@ namespace {
|
||||
IChatLog::ChatQuery query;
|
||||
query.characterId = characterId;
|
||||
query.includePrivate = Can(context, "chat_private");
|
||||
query.includeWhispers = Can(context, "chat_dms");
|
||||
query.newestFirst = true;
|
||||
query.limit = MAX_CHAT_LINES;
|
||||
auto messages = Database::Get()->GetChatMessages(query);
|
||||
|
||||
Reference in New Issue
Block a user