sas Fri Jul 4 03:18:32 2003 EDT
Modified files:
/php-src/ext/ircg ircg.c
Log:
simplify ctcp code
Index: php-src/ext/ircg/ircg.c
diff -u php-src/ext/ircg/ircg.c:1.190 php-src/ext/ircg/ircg.c:1.191
--- php-src/ext/ircg/ircg.c:1.190 Thu Jun 26 14:06:20 2003
+++ php-src/ext/ircg/ircg.c Fri Jul 4 03:18:32 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.190 2003/06/26 18:06:20 sas Exp $ */
+/* $Id: ircg.c,v 1.191 2003/07/04 07:18:32 sas Exp $ */
/* {{{ includes */
@@ -533,7 +533,7 @@
real_msg_end = strchr(real_msg, '\001');
if (real_msg_end) {
format_msg_t **fmt_msg_p;
- smart_str tmp, tmp2;
+ smart_str tmp;
int status = 0;
*real_msg_end = '\0';
@@ -545,17 +545,6 @@
smart_str_setl(&tmp, real_msg, real_msg_end - real_msg);
- /*
- * If no `to� information was provided by the IRCG layer,
- * someone sent us a private CTCP message.
- * Otherwise, to will be the channel name or the nickname
- * of the recipient.
- */
-
- if (!to) {
- smart_str_setl(&tmp2, conn->conn.username,
conn->conn.username_len);
- to = &tmp2;
- }
format_msg(*fmt_msg_p, chan, to, from, &tmp, result,
conn->conn.username, conn->conn.username_len, &status);
if (status == 1)
@@ -574,7 +563,7 @@
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);
+ handle_ctcp(conn, chan, from, chan?chan:&s_username, msg, &m);
} else if (chan) {
FORMAT_MSG(conn, FMT_MSG_CHAN, chan, &s_username, from, msg, &m,
conn->conn.username, conn->conn.username_len);
} else {
@@ -595,7 +584,7 @@
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);
+ handle_ctcp(conn, chan, from, chan?chan:&s_username, 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 {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php