-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|
@@ -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.) | ||
|