Skip to content

Commit

Permalink
merge develop
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg committed Jan 2, 2024
1 parent 78698ba commit 94c3baa
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,8 @@ static int got353(char *from, char *msg)
* :[email protected] CHGHOST tehgeo foo.io
* changes user hostmask to [email protected]
*/
static int gotchghost(char *from, char *msg){
static int gotchghost(char *from, char *msg)
{
struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 };
struct userrec *u;
struct chanset_t *chan;
Expand Down Expand Up @@ -1312,6 +1313,34 @@ static int gotchghost(char *from, char *msg){
return 0;
}

/* got 353: NAMES
* <server> 353 <chan> :[+/@]nick [+/@]nick ....
*
* if userhost-in-names is enabled, nick is [email protected]
* this function is added solely to handle userhost-in-names stuff, and will
* update hostnames for nicks received
*/
static int got353(char *from, char *msg)
{
char *nameptr, *uhost, *nick;
struct chanset_t *chan;
memberlist *m;

if (find_capability("userhost-in-names")) {
nameptr = strchr(msg, ':');
while ((uhost = newsplit(&nameptr))) {
nick = splitnick(&uhost);
for (chan = chanset; chan; chan = chan->next) {
m = ismember(chan, nick);
if (m) {
strlcpy(m->userhost, uhost, UHOSTLEN);
}
}
}
}
return 0;
}

/* React to 396 numeric (HOSTHIDDEN), sent when user mode +x (hostmasking) was
* successfully set. Format:
* :barjavel.freenode.net 396 BeerBot unaffiliated/geo/bot/beerbot :is now your hidden host (set by services.)
Expand Down

0 comments on commit 94c3baa

Please sign in to comment.