mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-31 17:49:11 +00:00
Sync "except lists" between servers
Up to now, ban, invite, and G-Line lists have been synced between servers while linking -- but obviously nobody noticed that except list have been missing ever since. Until now. Thanks to "j4jackj", who reported this issue in #ngircd.
This commit is contained in:
parent
bf2eae3249
commit
84ff5a6eb9
@ -145,7 +145,27 @@ Announce_Server(CLIENT * Client, CLIENT * Server)
|
|||||||
#ifdef IRCPLUS
|
#ifdef IRCPLUS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Synchronize invite, ban, G- and K-Line lists between servers.
|
* Send a specific list to a remote server.
|
||||||
|
*/
|
||||||
|
static bool
|
||||||
|
Send_List(CLIENT *Client, CHANNEL *Chan, struct list_head *Head, char Type)
|
||||||
|
{
|
||||||
|
struct list_elem *elem;
|
||||||
|
|
||||||
|
elem = Lists_GetFirst(Head);
|
||||||
|
while (elem) {
|
||||||
|
if (!IRC_WriteStrClient(Client, "MODE %s +%c %s",
|
||||||
|
Channel_Name(Chan), Type,
|
||||||
|
Lists_GetMask(elem))) {
|
||||||
|
return DISCONNECTED;
|
||||||
|
}
|
||||||
|
elem = Lists_GetNext(elem);
|
||||||
|
}
|
||||||
|
return CONNECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Synchronize invite, ban, except, and G-Line lists between servers.
|
||||||
*
|
*
|
||||||
* @param Client New server.
|
* @param Client New server.
|
||||||
* @return CONNECTED or DISCONNECTED.
|
* @return CONNECTED or DISCONNECTED.
|
||||||
@ -173,30 +193,12 @@ Synchronize_Lists(CLIENT * Client)
|
|||||||
|
|
||||||
c = Channel_First();
|
c = Channel_First();
|
||||||
while (c) {
|
while (c) {
|
||||||
/* ban list */
|
if (!Send_List(Client, c, Channel_GetListExcepts(c), 'e'))
|
||||||
head = Channel_GetListBans(c);
|
|
||||||
elem = Lists_GetFirst(head);
|
|
||||||
while (elem) {
|
|
||||||
if (!IRC_WriteStrClient(Client, "MODE %s +b %s",
|
|
||||||
Channel_Name(c),
|
|
||||||
Lists_GetMask(elem))) {
|
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
if (!Send_List(Client, c, Channel_GetListBans(c), 'b'))
|
||||||
elem = Lists_GetNext(elem);
|
return DISCONNECTED;
|
||||||
}
|
if (!Send_List(Client, c, Channel_GetListInvites(c), 'I'))
|
||||||
|
|
||||||
/* invite list */
|
|
||||||
head = Channel_GetListInvites(c);
|
|
||||||
elem = Lists_GetFirst(head);
|
|
||||||
while (elem) {
|
|
||||||
if (!IRC_WriteStrClient(Client, "MODE %s +I %s",
|
|
||||||
Channel_Name(c),
|
|
||||||
Lists_GetMask(elem))) {
|
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
|
||||||
elem = Lists_GetNext(elem);
|
|
||||||
}
|
|
||||||
|
|
||||||
c = Channel_Next(c);
|
c = Channel_Next(c);
|
||||||
}
|
}
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
|
Loading…
Reference in New Issue
Block a user