sas             Sun Apr 15 17:24:14 2001 EDT

  Modified files:              
    /php4/ext/ircg      ircg.c 
  Log:
  Add support for banlists
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.57 php4/ext/ircg/ircg.c:1.58
--- php4/ext/ircg/ircg.c:1.57   Sat Apr 14 11:49:04 2001
+++ php4/ext/ircg/ircg.c        Sun Apr 15 17:24:14 2001
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ircg.c,v 1.57 2001/04/14 18:49:04 sas Exp $ */
+/* $Id: ircg.c,v 1.58 2001/04/16 00:24:14 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -62,6 +62,8 @@
        FMT_MSG_WHOIS_END,
        FMT_MSG_MODE_VOICE,
        FMT_MSG_MODE_OP,
+       FMT_MSG_BANLIST,
+       FMT_MSG_BANLIST_END,
        NO_FMTS
 };
 
@@ -135,7 +137,9 @@
        "%f is on channel %c<br />",
        "End of whois for %f<br />",
        "%f sets voice flag of %t to %m on %c<br />",
-       "%f sets channel operator flag of %t to %m on %c<br />"
+       "%f sets channel operator flag of %t to %m on %c<br />",
+       "banned from %c: %m<br />",
+       "end of ban list for %c<br />"
 };
 
 #define MSG(conn, type) \
@@ -508,6 +512,24 @@
        msg_send(conn, &m);
 }
 
+static void banlist_handler(irconn_t *ircc, smart_str *channel, smart_str *mask, void 
+*conn_data)
+{
+       php_irconn_t *conn = conn_data;
+       smart_str m = {0};
+
+       format_msg(MSG(conn, FMT_MSG_BANLIST), channel, NULL, NULL, mask, &m);
+       msg_send(conn, &m);
+}
+
+static void end_of_banlist_handler(irconn_t *ircc, smart_str *channel, void 
+*conn_data)
+{
+       php_irconn_t *conn = conn_data;
+       smart_str m = {0};
+
+       format_msg(MSG(conn, FMT_MSG_BANLIST_END), channel, NULL, NULL, NULL, &m);
+       msg_send(conn, &m);
+}
+
 static void user_add(irconn_t *ircc, smart_str *channel, smart_str *users,
                int nr, void *dummy)
 {
@@ -974,6 +996,11 @@
 
 #if IRCG_API_VERSION >= 20010310
        irc_register_hook(conn, IRCG_IDLE_RECV_QUEUE, idle_recv_queue);
+#endif
+
+#if IRCG_API_VERSION >= 20010416
+       irc_register_hook(conn, IRCG_BANLIST, banlist_handler);
+       irc_register_hook(conn, IRCG_ENDOFBANLIST, end_of_banlist_handler);
 #endif
 }
 



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to