Mercurial > irccd
diff irccdctl/watch_cli.cpp @ 574:18e80ec38ac7
Irccd: get rid of user/channel separation, closes #734
Do not make separate events on messages, notices and modes. This was
currently added because the original libircclient made these
distinctions between the both. In the IRC specification, the channel
represents both a nickname and a real channel.
Delete:
- onChannelMode,
- onChannelNotice,
- onQuery,
- onQueryCommand.
Add:
- Server.isSelf(target).
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 29 Nov 2017 14:44:36 +0100 |
parents | 9daccaeedcce |
children | 27587ff92a64 |
line wrap: on
line diff
--- a/irccdctl/watch_cli.cpp Wed Nov 29 09:48:40 2017 +0100 +++ b/irccdctl/watch_cli.cpp Wed Nov 29 14:44:36 2017 +0100 @@ -49,24 +49,6 @@ return "native"; } -void onChannelMode(const nlohmann::json &v) -{ - std::cout << "event: onChannelMode\n"; - std::cout << "server: " << json_util::pretty(v, "server") << "\n"; - std::cout << "origin: " << json_util::pretty(v, "origin") << "\n"; - std::cout << "mode: " << json_util::pretty(v, "mode") << "\n"; - std::cout << "argument: " << json_util::pretty(v, "argument") << "\n"; -} - -void onChannelNotice(const nlohmann::json &v) -{ - std::cout << "event: onChannelNotice\n"; - std::cout << "server: " << json_util::pretty(v, "server") << "\n"; - std::cout << "origin: " << json_util::pretty(v, "origin") << "\n"; - std::cout << "channel: " << json_util::pretty(v, "channel") << "\n"; - std::cout << "message: " << json_util::pretty(v, "message") << "\n"; -} - void onConnect(const nlohmann::json &v) { std::cout << "event: onConnect\n"; @@ -158,14 +140,6 @@ std::cout << "reason: " << json_util::pretty(v, "reason") << "\n"; } -void onQuery(const nlohmann::json &v) -{ - std::cout << "event: onQuery\n"; - std::cout << "server: " << json_util::pretty(v, "server") << "\n"; - std::cout << "origin: " << json_util::pretty(v, "origin") << "\n"; - std::cout << "message: " << json_util::pretty(v, "message") << "\n"; -} - void onTopic(const nlohmann::json &v) { std::cout << "event: onTopic\n"; @@ -186,8 +160,6 @@ } const std::unordered_map<std::string, std::function<void (const nlohmann::json&)>> events{ - { "onChannelMode", onChannelMode }, - { "onChannelNotice", onChannelNotice }, { "onConnect", onConnect }, { "onInvite", onInvite }, { "onJoin", onJoin }, @@ -199,7 +171,6 @@ { "onNick", onNick }, { "onNotice", onNotice }, { "onPart", onPart }, - { "onQuery", onQuery }, { "onTopic", onTopic }, { "onWhois", onWhois } };