فهرست منبع

NOTICE work. Need to show target. Also channel modes.

Steve Thielemann 3 سال پیش
والد
کامیت
97fccb5a8b
2فایلهای تغییر یافته به همراه15 افزوده شده و 0 حذف شده
  1. 10 0
      input.cpp
  2. 5 0
      render.cpp

+ 10 - 0
input.cpp

@@ -122,6 +122,16 @@ void parse_input(door::Door &door, ircClient &irc) {
       */
     }
 
+    if (cmd[0] == "/notice") {
+      std::string tmp = "NOTICE " + cmd[1] + " :" + cmd[2];
+      irc.write(tmp);
+      // build msg for render
+      tmp = ":" + irc.nick + "!" + " " + tmp;
+      message_stamp msg;
+      msg.buffer = irc_split(tmp);
+      render(msg, door, irc);
+    }
+
     if (cmd[0] == "/me") {
       cmd = split_limit(input, 2);
       std::string tmp =

+ 5 - 0
render.cpp

@@ -139,6 +139,7 @@ void render(message_stamp &msg_stamp, door::Door &door, ircClient &irc) {
   }
 
   if (cmd == "NOTICE") {
+    // NOTICE doesn't display the target (nick or channel)
     std::string tmp = irc_msg[3];
     tmp.erase(0, 1);
     stamp(msg_stamp.stamp, door);
@@ -258,6 +259,10 @@ void render(message_stamp &msg_stamp, door::Door &door, ircClient &irc) {
     // [:[email protected]] [MODE] [#chat] [+o Apollo]
     // ChanServ gives channel operator status to bugz
 
+    // Or, lets just keep it simple and do something like:
+    // source sets target mode [whatever]
+    // If not a channel: source sets target mode [whatever]
+
     std::string target = irc_msg[2];
     std::string nick = parse_nick(irc_msg[0]);
     std::string modes = irc_msg[3];