From d950304536f870ad989e0049e4e8b4a5a72a9315 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sat, 11 May 2019 12:27:46 +0100 Subject: Use our real client hostname provided by the IRCd dynamically instead of hardcoding one ourselves when relaying our own PRIVMSGs to other bouncer clients. --- blabouncer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index 1fa1d60..80d6940 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -48,7 +48,6 @@ #define IRCNICK "blabounce" // TODO: change this to a config option! #define IRCUSER "blabounce" // TODO: change this to a config option! #define IRCREALNAME "Mr Bla Bouncer" // TODO: change this to a config option! -#define IRCUSERHOST "tghost.co.uk" // TODO: change this to a config option! struct channel { char name[MAXCHANLENGTH]; @@ -683,7 +682,10 @@ int processircmessage(int *serversockfd, int *clientsockfd, char *str, int sourc // Rebuild to full PRIVMSG string and relay to all other clients char outgoingmsg[MAXDATASIZE]; // String to send to client - snprintf(outgoingmsg, MAXDATASIZE, ":%s!%s@%s %s", IRCNICK, IRCUSER, IRCUSERHOST, str); + if (!snprintf(outgoingmsg, MAXDATASIZE, ":%s %s", ircdstrings->nickuserhost, str)) { + fprintf(stderr, "Error while preparing PRIVMSG relay from another bouncer client.\n"); + exit(1); + } // Send to all except source client sendtoallclients(clientsockfd, fdmax, arr_clients, outgoingmsg, sourcefd); -- cgit v1.2.3