summary refs log tree commit diff
path: root/user.c
AgeCommit message (Collapse)Author
3 daysReplace all fd checks with pointer checksNakidai
They look cleaner and do the same
6 daysFix channel_exit()ing user_remove()Nakidai
When user user_remove() is called, that user quits all of the channels it was belonging to. But since channel_exit() mutates chanels array, it is incorrect to 1) compare with channels_c 2) access channels[i]. As a fix, 1) channels_c is not being compared throughout the loop but is assigned to i once, and then i decrements 2) channels is being accessed only as channels[0]
10 daysChange way to deal with modes in channelsNakidai
I thought it'd be fine to store modes as an array. But using this is awful experience. Take a look at simple NAMES command: it just needs to check whether some user is oper or voice or not, and with that approach it will need to iterate over an array of users, and for each user iterate over an array of modes. Or it is possible to optimize it, saving all interesting modes to a local buffer and then iterating over it. But those are attempts to fix broken design So, instead of array of modes there'll be lots of fields regarding each mode or kind of mode From now on (struct Channel).peers is not a simple array of peers, but the one with metainformation. This is done by making an array of structures, so there are renames throughout the code Also, I didn't like that it was users and not peers and this is a nice opportunity to rename it: in first place this was done to avoid thing that compiler somehow could silently ignore type change, but this is also a stylistic change reflecting my view on naming
2026-02-01Enhance registration messagesNakidai
Now ircd responds with all replies up to 4 Plus memchr was wrong, yep
2026-02-01Fix all the warningsNakidai
The one in user.c is the funniest one
2026-02-01Add exiting from a channel in user_removeNakidai
I think it should guarantee that nothing will break, including chanels
2026-01-10Check whether user was registered or not in user_reg()Nakidai
So, it fixes a situation when an already registered user wants to change their nick and ircd welcomes they
2026-01-10Add basic user mode handlingNakidai
So, now there're all modes listed in RFC 2812. The only what they do now, though, is a +r restricting user from changing their nick
2026-01-07Fix user quitNakidai
When user A leaves, last user in the peer list B is copied into the space left by leaving A. But, besides that it also important to not forget that there can be channels containing B: they store a link to every user belonging. So, it's important to adjust all links to B iterating every channel B belongs to.
2026-01-06Add basic channelsNakidai
Though they don't have modes, and JOIN/PART must be able to parse comma separated list of channels
2026-01-04Add codeNakidai