$ git clone http://tcclient.ion.nu/tc_client.git
commit 55bae3cfbe5b3b00f8024c01ec3c77421d032283
Author: Alicia <...>
Date: Wed May 4 15:46:41 2016 +0200
irchack: fixed the order of messages around joining a channel (should fix compatibility with IRC clients a bit pickier than irssi)
diff --git a/ChangeLog b/ChangeLog
index 2a27ad4..c68dd53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@ tc_client-gtk: added an option to use the --cookies parameter of the core to kee
tc_client-gtk and camviewer: fixed compatibility with newer libavutil.
tc_client-gtk and camviewer: added compatibility fallbacks for av_image_get_buffer_size() and av_packet_unref()
libcamera(v4l2): if we failed to read the frame, give grey instead.
+irchack: fixed the order of messages around joining a channel (should fix compatibility with IRC clients a bit pickier than irssi)
0.38:
Handle multi-line messages.
Added option --hexcolors to print hex color codes instead of ANSI color escape codes.
diff --git a/utilities/irchack/irchack.c b/utilities/irchack/irchack.c
index 54009e8..d6ba491 100644
--- a/utilities/irchack/irchack.c
+++ b/utilities/irchack/irchack.c
@@ -219,6 +219,7 @@ char session(int sock, const char* nick, const char* channel, const char* pass,
pfd[1].revents=0;
char buf[2048];
char joins=0;
+ char gotconnectionid=0;
while(1)
{
poll(pfd, 2, -1);
@@ -279,6 +280,7 @@ printf("Got from tc_client: '%s'\n", buf);
}
if(!strncmp(buf, "Connection ID: ", 15))
{
+ gotconnectionid=1;
dprintf(sock, ":%s!user@host NICK :guest-%s\n", nick, &buf[15]);
continue;
}
@@ -291,7 +293,7 @@ printf("Got from tc_client: '%s'\n", buf);
if(space && !strcmp(space, " is a moderator."))
{
space[0]=0;
- dprintf(sock, ":irchack MODE #%s +o %s\n", channel, buf);
+ dprintf(sock, ":irchack MODE #%s +o %s\n", channel, gotconnectionid?buf:nick);
continue;
}
if(space && !strcmp(space, " is no longer a moderator."))
@@ -369,7 +371,11 @@ printf("Got from tc_client: '%s'\n", buf);
msg=&msg[1];
if(!strcmp(msg, "entered the channel"))
{
- dprintf(sock, ":%s!user@host JOIN #%s\n", name, channel);
+ dprintf(sock, ":%s!user@host JOIN #%s\n", gotconnectionid?name:nick, channel);
+ if(!gotconnectionid)
+ {
+ dprintf(sock, ":irchack 353 %s = #%s :%s\n", nick, channel, nick);
+ }
}
else if(!strncmp(msg, "changed nickname to ", 20))
{