diff options
| author | Nakidai <nakidai@disroot.org> | 2026-01-07 00:43:50 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2026-01-07 00:43:50 +0300 |
| commit | 62f4f17989622a91aa39834b73d4e527a96ce211 (patch) | |
| tree | a693349fb3f6545cd6f793286cbd11f070eeb5cc /loop.c | |
| parent | 63c0a8860459c0c9bf3b66d4d4ec631ece4bf56e (diff) | |
| download | libreircd-62f4f17989622a91aa39834b73d4e527a96ce211.tar.gz libreircd-62f4f17989622a91aa39834b73d4e527a96ce211.zip | |
Move quit announcement code to quit()
Well, it's more appropriate for that function to handle this rather than for ircd(). Now code looks simpler, ircd() is not that complex, and support for optional quit message is present
Diffstat (limited to 'loop.c')
| -rw-r--r-- | loop.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/loop.c b/loop.c index 9e91438..aa3f458 100644 --- a/loop.c +++ b/loop.c @@ -39,7 +39,7 @@ int port; void ircd(void) { - size_t i, j, k; + size_t i; struct sockaddr_in addr, clientaddr; int res, sfd, client; nfds_t passed; @@ -123,32 +123,6 @@ loop: if (!(peers[i].flags & DELETE)) continue; - if (peers[i].type) - writef( - peers[i].fd, - ":%s!%s@%s QUIT", - getnick(&peers[i]), - peers[i].user, - peers[i].host - ); - for (j = 0; j < peers[i].channels_c; ++j) - { - channel_exit(peers[i].channels[j], &peers[i]); - if (peers[i].type) for (k = 0; k < peers[i].channels[j]->users_c; ++k) - peers[i].channels[j]->users[k]->flags |= ANNOUNCE; - } - for (j = 0; j < peers_c; ++j) - if (peers[j].flags & ANNOUNCE) - { - writef( - peers[j].fd, - ":%s!%s@%s QUIT", - getnick(&peers[i]), - peers[i].user, - peers[i].host - ); - peers[j].flags &= ~ANNOUNCE; - } writef(peers[i].fd, "ERROR :Closing Link: %s", peers[i].host); close(peers[i].fd); user_remove(i); |