mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 01:23:24 -08:00
* [Client] Add room channel selector with per-channel chat views
* [Client] Tabbed room channels with unread states, collapse, read-only, banners
Reworks the room chat channel display: channels move out of the combobox
into a tab bar below the message input showing every channel available
to the user.
- Each tab shows its unread message count and is tinted when it holds
unreads or a mention; both colors are user-configurable chat settings
(channelUnreadColor, channelMentionColor) with a settings-page section.
- Clicking the active tab collapses the chat: message view and input
hide and the splitter section minimizes to the tab strip; expanding
restores the previous splitter sizes. Viewing a channel clears its
unread state.
- Channels the user may read but not write (per write_access_level)
show with the message input disabled and a read-only placeholder;
sends are guarded locally, the server still enforces.
- Channel banner_message strings render at the top of their channel
view on join, like the room join message on Main.
- Replayed channel history no longer inflates unread counts; moderation
redaction now applies across all channel views.
* Fixup: keep chat tab bar visible when chat is collapsed
QSplitter children are collapsible by default, so setSizes({1, 0})
hid the whole chat group box including the channel tab bar.
Mark the chat widget non-collapsible so collapsing clamps to its
minimum size (title + tab bar) instead.
* [Room] Explicitly initialize MAIN_CHANNEL per review
* [Room] Address channel tab review follow-ups
- gate @all mentions on moderator/admin sender to match ChatView,
whole-word matching for own name and highlight words
- hide single-channel tab bar so old servers do not show a lone Main
tab that collapses chat on misclick
- capture target ChatView in sendMessage so errors land in the
channel the message was sent from
- share ignore/unregistered filtering between RoomSay and
RoomChannelSay via isRoomMessageIgnored
* [Client] Fix tab_room.cpp formatting per clang-format-18
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: BruebachL <bruebachl@cockatrice.example>
64 lines
2.7 KiB
C++
64 lines
2.7 KiB
C++
#ifndef CHAT_SETTINGS_H
|
|
#define CHAT_SETTINGS_H
|
|
|
|
#include "settings_manager.h"
|
|
|
|
#include <QString>
|
|
#include <libcockatrice/interfaces/interface_chat_settings_provider.h>
|
|
#include <qtmetamacros.h>
|
|
|
|
class QObject;
|
|
|
|
class ChatSettings : public SettingsManager, public IChatSettingsProvider
|
|
{
|
|
Q_OBJECT
|
|
friend class SettingsCache;
|
|
|
|
public:
|
|
[[nodiscard]] bool getChatMention() const override;
|
|
[[nodiscard]] bool getChatMentionCompleter() const override;
|
|
[[nodiscard]] QString getChatMentionColor() const override;
|
|
[[nodiscard]] QString getChatHighlightColor() const override;
|
|
[[nodiscard]] QString getChannelUnreadColor() const override;
|
|
[[nodiscard]] QString getChannelMentionColor() const override;
|
|
[[nodiscard]] bool getChatMentionForeground() const override;
|
|
[[nodiscard]] bool getChatHighlightForeground() const override;
|
|
[[nodiscard]] bool getIgnoreUnregisteredUsers() const override;
|
|
[[nodiscard]] bool getIgnoreUnregisteredUserMessages() const override;
|
|
[[nodiscard]] bool getIgnoreNonBuddyUserMessages() const override;
|
|
[[nodiscard]] bool getShowMessagePopup() const override;
|
|
[[nodiscard]] bool getShowMentionPopup() const override;
|
|
[[nodiscard]] bool getRoomHistory() const override;
|
|
[[nodiscard]] bool getIgnoreAllPrivateMessages() const override;
|
|
[[nodiscard]] bool getUseGameTime() const override;
|
|
[[nodiscard]] QString getHighlightWords() const override;
|
|
|
|
void setChatMention(bool _chatMention);
|
|
void setChatMentionCompleter(bool _chatMentionCompleter);
|
|
void setChatMentionColor(const QString &_chatMentionColor);
|
|
void setChatHighlightColor(const QString &_chatHighlightColor);
|
|
void setChannelUnreadColor(const QString &_channelUnreadColor);
|
|
void setChannelMentionColor(const QString &_channelMentionColor);
|
|
void setChatMentionForeground(bool _chatMentionForeground);
|
|
void setChatHighlightForeground(bool _chatHighlightForeground);
|
|
void setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers);
|
|
void setIgnoreUnregisteredUserMessages(bool _ignoreUnregisteredUserMessages);
|
|
void setIgnoreNonBuddyUserMessages(bool _ignoreNonBuddyUserMessages);
|
|
void setShowMessagePopups(bool _showMessagePopups);
|
|
void setShowMentionPopups(bool _showMentionPopups);
|
|
void setRoomHistory(bool _roomHistory);
|
|
void setIgnoreAllPrivateMessages(bool _ignoreAllPrivateMessages);
|
|
void setUseGameTime(bool _useGameTime);
|
|
void setHighlightWords(const QString &_highlightWords);
|
|
|
|
signals:
|
|
void chatMentionCompleterChanged();
|
|
|
|
public:
|
|
explicit ChatSettings(const QString &settingPath, QObject *parent = nullptr);
|
|
|
|
private:
|
|
ChatSettings(const ChatSettings & /*other*/);
|
|
};
|
|
|
|
#endif // CHAT_SETTINGS_H
|