aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sircbot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sircbot.c b/sircbot.c
index 0999ac5..1a681d2 100644
--- a/sircbot.c
+++ b/sircbot.c
@@ -203,7 +203,8 @@ int handle_response(struct irc_session *sess, char *user, char *cmd, char *data,
return irc_send(sess, "PONG", data);
} else if (strncmp(cmd, "PONG", 4) == 0) {
sess->last_pong = time(NULL);
- } else if (strncmp(cmd, "JOIN", 4) == 0) {
+ } else if (strncmp(cmd, "JOIN", 4) == 0 &&
+ strncmp(user, sess->nick, strlen(sess->nick)) == 0) {
return join_channel(chan, numchan, data);
} else if (strncmp(cmd, "KICK", 4) == 0) {
char *p = strchr(data, ' ');