[PHP-CVS] cvs: php-src /ext/ircg ircg.c php_ircg_formats.h

2003-07-07 Thread Sascha Schumann
sas Mon Jul  7 11:45:44 2003 EDT

  Modified files:  
/php-src/ext/ircg   ircg.c php_ircg_formats.h 
  Log:
  add lusers related format messages
  
  
Index: php-src/ext/ircg/ircg.c
diff -u php-src/ext/ircg/ircg.c:1.191 php-src/ext/ircg/ircg.c:1.192
--- php-src/ext/ircg/ircg.c:1.191   Fri Jul  4 03:18:32 2003
+++ php-src/ext/ircg/ircg.c Mon Jul  7 11:45:43 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: ircg.c,v 1.191 2003/07/04 07:18:32 sas Exp $ */
+/* $Id: ircg.c,v 1.192 2003/07/07 15:45:43 sas Exp $ */
 
 /* {{{ includes */
 
@@ -218,6 +218,11 @@
[notice %c] %f: %mbr /,
notice from %f: %mbr /,
notice to %t: %mbr /,
+%t users, %f services, %r serversbr /,
+%r operatorsbr /,
+%r unknown connectionsbr /,
+%r formed channelsbr /,
+I have %t clients and %r serversbr /,
 };
 
 ZEND_DECLARE_MODULE_GLOBALS(ircg);
Index: php-src/ext/ircg/php_ircg_formats.h
diff -u php-src/ext/ircg/php_ircg_formats.h:1.2 php-src/ext/ircg/php_ircg_formats.h:1.3
--- php-src/ext/ircg/php_ircg_formats.h:1.2 Thu Jun 26 14:06:20 2003
+++ php-src/ext/ircg/php_ircg_formats.h Mon Jul  7 11:45:43 2003
@@ -35,6 +35,11 @@
FMT_MSG_NOTICE_CHAN,
FMT_MSG_NOTICE_TO_ME,
FMT_MSG_NOTICE_FROM_ME,
+FMT_MSG_LUSERCLIENT,
+FMT_MSG_LUSEROP,
+FMT_MSG_LUSERUNKNOWN,
+FMT_MSG_LUSERCHANNELS,
+FMT_MSG_LUSERME,
NO_FMTS
 };
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ircg ircg.c php_ircg_formats.h

2003-06-26 Thread Sascha Schumann
sas Thu Jun 26 14:06:20 2003 EDT

  Modified files:  
/php-src/ext/ircg   ircg.c php_ircg_formats.h 
  Log:
  Add NOTICE handling
  
  
Index: php-src/ext/ircg/ircg.c
diff -u php-src/ext/ircg/ircg.c:1.189 php-src/ext/ircg/ircg.c:1.190
--- php-src/ext/ircg/ircg.c:1.189   Tue Jun 17 19:35:19 2003
+++ php-src/ext/ircg/ircg.c Thu Jun 26 14:06:20 2003
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: ircg.c,v 1.189 2003/06/17 23:35:19 sas Exp $ */
+/* $Id: ircg.c,v 1.190 2003/06/26 18:06:20 sas Exp $ */
 
 /* {{{ includes */
 
@@ -184,8 +184,8 @@
 
 static char *fmt_msgs_default[] = {
[%c] %f: %mbr /,
-   privat from %f: %mbr /,
-   %f privat to %t: %mbr /,
+   private from %f: %mbr /,
+   %f private to %t: %mbr /,
%f leaves %cbr /,
%f joins %cbr /,
%t was kicked by %f from %c (%m)br /,
@@ -215,6 +215,9 @@
is on server %t, has flag %f, hopcount %m, and channel %c.br /,
end of whobr /,
%f is inviting %t to %cbr /,
+   [notice %c] %f: %mbr /,
+   notice from %f: %mbr /,
+   notice to %t: %mbr /,
 };
 
 ZEND_DECLARE_MODULE_GLOBALS(ircg);
@@ -560,7 +563,6 @@
}
}
 }
-   
 
 static void msg_handler(irconn_t *ircc, smart_str *chan, smart_str *from,
smart_str *msg, void *conn_data, void *chan_data)
@@ -583,6 +585,27 @@
msg_send(conn, m);
 }
 
+static void notice_handler(irconn_t *ircc, smart_str *chan, smart_str *from,
+   smart_str *msg, void *conn_data, void *chan_data)
+{
+   php_irconn_t *conn = conn_data;
+   smart_str m = {0};
+   smart_str s_username;
+
+   smart_str_setl(s_username, ircc-username, ircc-username_len);
+
+   if (msg-c[0] == '\001') {
+   handle_ctcp(conn, chan, from, chan?chan:NULL, msg, m);
+   } else if (chan) {
+   FORMAT_MSG(conn, FMT_MSG_NOTICE_CHAN, chan, s_username, from, msg, 
m, conn-conn.username, conn-conn.username_len);
+   } else {
+   FORMAT_MSG(conn, FMT_MSG_NOTICE_TO_ME, NULL, s_username, from,
+   msg, m, conn-conn.username, conn-conn.username_len);
+   }
+
+   msg_send(conn, m);
+}
+
 static void nick_handler(irconn_t *c, smart_str *oldnick, smart_str *newnick,
void *dummy)
 {
@@ -1803,6 +1826,7 @@
IRCG_CB_MAP_ENTRY(whoreply_handler)
IRCG_CB_MAP_ENTRY(endofwho_handler)
IRCG_CB_MAP_ENTRY(invite_handler)
+   IRCG_CB_MAP_ENTRY(notice_handler)
 IRCG_CB_MAP_END()
 
 /* {{{ register_hooks */
@@ -1892,6 +1916,8 @@
IFMSG(FMT_MSG_INVITE, IRCG_INVITE, invite_handler);
 #endif
 
+   irc_register_hook(conn, IRCG_NOTICE, notice_handler);
+   
irc_set_map_handle(conn, php_ircg_cb_msg_handle);
 }
 /* }}} */
Index: php-src/ext/ircg/php_ircg_formats.h
diff -u php-src/ext/ircg/php_ircg_formats.h:1.1 php-src/ext/ircg/php_ircg_formats.h:1.2
--- php-src/ext/ircg/php_ircg_formats.h:1.1 Mon Dec  9 07:42:28 2002
+++ php-src/ext/ircg/php_ircg_formats.h Thu Jun 26 14:06:20 2003
@@ -32,6 +32,9 @@
FMT_MSG_WHOREPLY2,
FMT_MSG_ENDOFWHO,
FMT_MSG_INVITE,
+   FMT_MSG_NOTICE_CHAN,
+   FMT_MSG_NOTICE_TO_ME,
+   FMT_MSG_NOTICE_FROM_ME,
NO_FMTS
 };
 /* }}} */



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php