1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

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.
This commit is contained in:
Andreas Kling 2019-03-15 17:37:13 +01:00
parent ad08165a25
commit 1fc283ed7d
12 changed files with 126 additions and 23 deletions

View file

@ -13,6 +13,7 @@ class IRCClientWindowListModel;
class GNotifier;
class IRCClient {
friend class IRCChannel;
public:
IRCClient(const String& address, int port = 6667);
~IRCClient();
@ -45,6 +46,10 @@ public:
const IRCClientWindow& window_at(int index) const { return *m_windows.at(index); }
IRCClientWindow& window_at(int index) { return *m_windows.at(index); }
void handle_user_input_in_channel(const String& channel_name, const String&);
void handle_user_input_in_query(const String& query_name, const String&);
void handle_user_input_in_server(const String&);
private:
struct Message {
String prefix;
@ -57,6 +62,7 @@ private:
void send_user();
void send_nick();
void send_pong(const String& server);
void send_privmsg(const String& target, const String&);
void process_line();
void handle_join(const Message&);
void handle_ping(const Message&);
@ -64,6 +70,7 @@ private:
void handle_privmsg(const Message&);
void handle(const Message&, const String& verbatim);
IRCQuery& ensure_query(const String& name);
IRCChannel& ensure_channel(const String& name);
String m_hostname;
int m_port { 0 };