diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-11 12:27:46 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-11 12:27:46 +0100 |
commit | d950304536f870ad989e0049e4e8b4a5a72a9315 (patch) | |
tree | 18b28ff1ab33854f7591543de80ffe953c35644c /blabouncer.c | |
parent | d11ccc70a00fbb2bdafb7301512999da0add0f79 (diff) |
Use our real client hostname provided by the IRCd dynamically instead of hardcoding one ourselves when relaying our own PRIVMSGs to other bouncer clients.
Diffstat (limited to 'blabouncer.c')
-rw-r--r-- | blabouncer.c | 6 |
1 files changed, 4 insertions, 2 deletions
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); |