cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Tue, 14 Nov 2000 16:19:31 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-2606@lists.php.net to get a copy of this message | ||
sas Tue Nov 14 08:19:31 2000 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Add kick handler
Requires ircg 0.3 or later
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.2 php4/ext/ircg/ircg.c:1.3
--- php4/ext/ircg/ircg.c:1.2 Tue Nov 14 07:40:14 2000
+++ php4/ext/ircg/ircg.c Tue Nov 14 08:19:31 2000
@@ -224,6 +224,16 @@
smart_str_free_ex(&m, 1);
}
+static void user_kick(irconn_t *ircc, const char *channel, smart_str *who, smart_str *kicked_by,
smart_str *reason, void *dummy)
+{
+ php_irconn_t *conn = dummy;
+ smart_str m = {0};
+
+ format_msg(MSG(conn, FMT_MSG_KICK), channel, who->c, kicked_by->c,
reason?reason->c:"", &m);
+ msg_send(conn, &m);
+ smart_str_free_ex(&m, 1);
+}
+
static void http_closed_connection(int fd)
{
int *id;
@@ -285,7 +295,7 @@
if (!conn) RETURN_FALSE;
- irc_join(&conn->conn, Z_STRVAL_PP(p2), NULL, NULL, user_add, user_leave, conn);
+ irc_join(&conn->conn, Z_STRVAL_PP(p2), NULL, NULL, user_add, user_leave, user_kick, conn);
RETVAL_TRUE;
}
@@ -310,7 +320,7 @@
PHP_FUNCTION(ircg_pconnect)
{
- zval **p1, **p2, **p3, **p4;
+ zval **p1, **p2, **p3, **p4 = NULL;
const char *username;
const char *server = "0";
int port = 6667;