diff options
| author | Nakidai Perumenei <nakidai@disroot.org> | 2026-12-02 20:52:27 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2026-01-30 15:32:45 +0300 |
| commit | 0e426a3395a95f08b47bdad512a0eaabbc5701d4 (patch) | |
| tree | e341bfe72b67d2f5bfccee9345b62e9740cea25a /handle.c | |
| parent | 559fac39d83083f1720b235e33a8219ed07de653 (diff) | |
| download | libreircd-0e426a3395a95f08b47bdad512a0eaabbc5701d4.tar.gz libreircd-0e426a3395a95f08b47bdad512a0eaabbc5701d4.zip | |
Move announcing code to writef.c
Well, I guess that code is needed more then once, so it'll be good to move it to some function
Diffstat (limited to 'handle.c')
| -rw-r--r-- | handle.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/handle.c b/handle.c index 0515ac2..038a300 100644 --- a/handle.c +++ b/handle.c @@ -210,39 +210,20 @@ privmsg(struct Message *msg, struct Peer *peer) static int quit(struct Message *msg, struct Peer *peer) { - size_t i, j; + size_t i; ensure(peer->type, (void)0, 1) - writef( - peer->fd, + announce( + peer, ":%s!%s@%s QUIT :%s", getnick(peer), peer->user, peer->host, msg->params[0] ? msg->params[0] : "Client Quit" ); - for (i = 0; i < peer->channels_c; ++i) - { channel_exit(peer->channels[i], peer); - for (j = 0; j < peer->channels[i]->users_c; ++j) - peer->channels[i]->users[j]->flags |= ANNOUNCE; - } - - for (i = 0; i < peers_c; ++i) - if (peers[i].flags & ANNOUNCE) - { - writef( - peers[i].fd, - ":%s!%s@%s QUIT :%s", - getnick(peer), - peer->user, - peer->host, - msg->params[0] ? msg->params[0] : "Client Quit" - ); - peers[i].flags &= ~ANNOUNCE; - } return 1; } |