changeset 41:a5f2d5d41994

Irccd: use message property instead of notice for consistency on*Notice
author David Demelier <markand@malikania.fr>
date Thu, 25 Feb 2016 22:07:29 +0100
parents 909eb532ca9a
children 0157b970f238
files irccd/irccd.cpp irccdctl/command-watch.cpp
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/irccd/irccd.cpp	Wed Feb 24 21:48:00 2016 +0100
+++ b/irccd/irccd.cpp	Thu Feb 25 22:07:29 2016 +0100
@@ -49,6 +49,7 @@
 		{ "event",	"onChannelMode"		},
 		{ "server",	server->info().name	},
 		{ "origin",	origin			},
+		{ "channel",	channel			},
 		{ "mode",	mode			},
 		{ "argument",	arg			}
 	});
@@ -65,7 +66,7 @@
 	});
 }
 
-void Irccd::handleServerChannelNotice(std::weak_ptr<Server> ptr, std::string origin, std::string channel, std::string notice)
+void Irccd::handleServerChannelNotice(std::weak_ptr<Server> ptr, std::string origin, std::string channel, std::string message)
 {
 	std::shared_ptr<Server> server = ptr.lock();
 
@@ -75,14 +76,14 @@
 	log::debug() << "server " << server->info().name << ": event onChannelNotice:\n";
 	log::debug() << "  origin: " << origin << "\n";
 	log::debug() << "  channel: " << channel << "\n";
-	log::debug() << "  notice: " << notice << std::endl;
+	log::debug() << "  message: " << message << std::endl;
 
 	json::Value json = json::object({
 		{ "event",	"onChannelNotice"	},
 		{ "server",	server->info().name	},
 		{ "origin",	origin			},
 		{ "channel",	channel			},
-		{ "notice",	notice			}
+		{ "message",	message			}
 	});
 
 	postServerEvent({server->info().name, origin, channel, json.toJson(0)
@@ -91,7 +92,7 @@
 			return "onChannelNotice";
 		}
 		, [=] (Plugin &plugin) {
-			plugin.onChannelNotice(std::move(server), std::move(origin), std::move(channel), std::move(notice));
+			plugin.onChannelNotice(std::move(server), std::move(origin), std::move(channel), std::move(message));
 		}
 #endif
 	});
@@ -393,7 +394,7 @@
 		{ "event",	"onNotice"		},
 		{ "server",	server->info().name	},
 		{ "origin",	origin			},
-		{ "notice",	message			}
+		{ "message",	message			}
 	});
 
 	postServerEvent({server->info().name, origin, /* channel */ "", json.toJson(0)
@@ -526,8 +527,7 @@
 		{ "nickname",	whois.nick		},
 		{ "username",	whois.user		},
 		{ "host",	whois.host		},
-		{ "realname",	whois.realname		},
-		{ "channels",	""			}
+		{ "realname",	whois.realname		}
 	});
 
 	postServerEvent({server->info().name, /* origin */ "", /* channel */ "", object.toJson(-1)
--- a/irccdctl/command-watch.cpp	Wed Feb 24 21:48:00 2016 +0100
+++ b/irccdctl/command-watch.cpp	Thu Feb 25 22:07:29 2016 +0100
@@ -41,7 +41,7 @@
 	std::cout << "server:      " << v.valueOr("server", "").toString() << "\n";
 	std::cout << "origin:      " << v.valueOr("origin", "").toString() << "\n";
 	std::cout << "channel:     " << v.valueOr("channel", "").toString() << "\n";
-	std::cout << "notice:      " << v.valueOr("notice", "").toString() << "\n";
+	std::cout << "message:     " << v.valueOr("message", "").toString() << "\n";
 }
 
 void onConnect(const json::Value &v)
@@ -123,7 +123,7 @@
 	std::cout << "event:       onNotice\n";
 	std::cout << "server:      " << v.valueOr("server", "").toString() << "\n";
 	std::cout << "origin:      " << v.valueOr("origin", "").toString() << "\n";
-	std::cout << "notice:      " << v.valueOr("notice", "").toString() << "\n";
+	std::cout << "message:      " << v.valueOr("message", "").toString() << "\n";
 }
 
 void onPart(const json::Value &v)