diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-15 17:37:13 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-15 17:37:13 +0100 |
commit | 1fc283ed7dc504a519db57d442f498e3c803586b (patch) | |
tree | 69f383daf37a3e7d453f0a72068afd50a37af438 /Applications/IRCClient/IRCChannel.cpp | |
parent | ad08165a252d096ba7e4730efce9fb96181b5373 (diff) | |
download | serenity-1fc283ed7dc504a519db57d442f498e3c803586b.zip |
IRCClient+LibGUI: Add an input box so we can send messages to channels.
Implement this using a GTextEditor with a special single-line mode.
This new mode needs some polishing, but it's already very useful.
Diffstat (limited to 'Applications/IRCClient/IRCChannel.cpp')
-rw-r--r-- | Applications/IRCClient/IRCChannel.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Applications/IRCClient/IRCChannel.cpp b/Applications/IRCClient/IRCChannel.cpp index 1c6bec841b..45e7acb0b7 100644 --- a/Applications/IRCClient/IRCChannel.cpp +++ b/Applications/IRCClient/IRCChannel.cpp @@ -40,8 +40,13 @@ void IRCChannel::add_message(char prefix, const String& name, const String& text void IRCChannel::dump() const { printf("IRCChannel{%p}: %s\n", this, m_name.characters()); - for (auto& member : m_members) { + for (auto& member : m_members) printf(" (%c)%s\n", member.prefix ? member.prefix : ' ', member.name.characters()); - } log().dump(); } + +void IRCChannel::say(const String& text) +{ + m_client.send_privmsg(m_name, text); + add_message(' ', m_client.nickname(), text); +} |