diff options
-rw-r--r-- | core.h | 2 | ||||
-rw-r--r-- | ircserver.cpp | 3 | ||||
-rw-r--r-- | window.cpp | 8 |
3 files changed, 13 insertions, 0 deletions
@@ -98,6 +98,8 @@ public: void handlePrivmsg(const UserRef &user, const char *str); char getEffectivePrefixChar(const char *nick) const; + + void disconnected(); }; diff --git a/ircserver.cpp b/ircserver.cpp index 7e20310..31cbd6d 100644 --- a/ircserver.cpp +++ b/ircserver.cpp @@ -73,6 +73,9 @@ void IRCServer::connectedEvent() { void IRCServer::disconnectedEvent() { printf("[IRCServer:%p] disconnectedEvent\n", this); status.pushMessage("Disconnected."); + + for (auto &i : channels) + i.second->disconnected(); } void IRCServer::lineReceivedEvent(char *line, int size) { printf("[%d] { %s }\n", size, line); @@ -356,3 +356,11 @@ char Channel::getEffectivePrefixChar(const char *nick) const { return 0; } + + +void Channel::disconnected() { + if (inChannel) { + inChannel = false; + pushMessage("You have been disconnected."); + } +} |