cvs: php4 /ext/ircg ircg.c
| From: | Sascha Schumann | Date: | Mon, 03 Dec 2001 12:13:47 +0000 |
| Subject: | cvs: php4 /ext/ircg ircg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8407@lists.php.net to get a copy of this message | ||
sas Mon Dec 3 07:13:47 2001 EDT
Modified files:
/php4/ext/ircg ircg.c
Log:
Extend the meaning of "bailout on trivial" to also cover kicks. This
is a simple method to free a nick for custom chat systems.
External programs can now also savely truncate the file IRCG writes to,
because we open those files with O_APPEND, so that the write pointer
is always at the end of the data.
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.117 php4/ext/ircg/ircg.c:1.118
--- php4/ext/ircg/ircg.c:1.117 Tue Nov 27 09:19:59 2001
+++ php4/ext/ircg/ircg.c Mon Dec 3 07:13:47 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg.c,v 1.117 2001/11/27 14:19:59 sas Exp $ */
+/* $Id: ircg.c,v 1.118 2001/12/03 12:13:47 sas Exp $ */
/* {{{ includes */
@@ -1072,6 +1072,9 @@
php_irconn_t *conn = dummy;
smart_str m = {0};
+ if (conn->bailout_on_trivial && who->len == ircc->username_len &&
memcmp(who->c, ircc->username, who->len) == 0) {
+ irc_disconnect(ircc, "Bailout on trivial: KICK");
+ }
format_msg(MSG(conn, FMT_MSG_KICK), channel, who, kicked_by, reason, &m,
conn->conn.username, conn->conn.username_len);
msg_send(conn, &m);
}
@@ -1181,7 +1184,7 @@
if (conn->file_fd != -1)
close(conn->file_fd);
- conn->file_fd = open(Z_STRVAL_PP(p2), O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ conn->file_fd = open(Z_STRVAL_PP(p2), O_WRONLY | O_CREAT | O_TRUNC | O_APPEND, 0644);
if (conn->file_fd == -1) {
RETURN_FALSE;
}