summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 4127b6a..07461b8 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -7,6 +7,8 @@
// - Get CAP from server and relay to client
// - Add blabouncer MOTD (375, 372, 376)
// - "01:53:47 -!- ServerMode/#test [b] by irc.tghost.co.uk" on existing clients when new client connects
+// - Other users PARTing causes us to PART
+// - We might not track new users JOINing a channel (only users who were already in a channel when we joined)
//
// Example WHOIS reply:
// BOUNCER-SERVER RECEIVED: :irc.tghost.co.uk 307 blabounce l_bratch :is identified for this nick
@@ -925,6 +927,28 @@ void dochat(int *serversockfd, int *clientsockfd) {
printf ("Error! Too long. Would have allowed up to: [%s]\n", outgoingmsg);
}
+ // STDIN based commands for debugging
+ if (strncmp(outgoingmsg, "listchannels", strlen("listchannels")) == 0) {
+ printf("STDIN command starting: listchannels\n");
+
+ int channelcount = getchannelcount(channels);
+
+ for (int i = 0; i < channelcount; i++) {
+ printf("Checking channel[%d] out of %d.\n", i, channelcount);
+ // Skip this one and increment channelcount if it's a blank channel
+ if (!channels[i].name[0]) {
+ printf("Skipping channel[%d], incrementing channelcount.\n", i);
+ channelcount++;
+ continue;
+ }
+
+ printf("Found channel '%s'.\n", channels[i].name);
+ }
+
+ printf("STDIN command complete: listchannels\n");
+ continue;
+ }
+
sendtoserver(serversockfd, outgoingmsg, strlen(outgoingmsg));
}