summary refs log tree commit diff
AgeCommit message (Collapse)Author
3 daysShow topic in LIST HEAD v0.2.0 masterNakidai
Well, it was an empty string because back then topics weren't done yet
3 daysReplace all fd checks with pointer checksNakidai
They look cleaner and do the same
3 daysAdd support for voice and +m channel modeNakidai
So now voices in code are not that useless. Also, code was fixed for their printing as it is valid for a user to be both an oper and voiced
3 daysFix & Refactor NAMESNakidai
When generating a string to respond, there's a condition to either put a space and continue or the send string and start collecting again. If after the loop send buffer is non-empty, it should be sent as well. But there's an issue: that last line after the loop contains a trailing whitespace. So some clients can put a comma to the end and some bots probably can even break because of that. One solution is to simply buf[strlen(buf)-1]=0; but this doesn't feel right. My solution is to add a check to the condition in loop whether this iteration is last. If so - print. By the way this eliminates the need in post-loop condition reducing reply(353) duplication
3 daysFix some typos in SETOPERNakidai
- nick and pass can have different size - not PEERS_MAX, but opers_c
4 daysAdd sending topic on joinNakidai
When user joins, it should get topic message
4 daysAdd TOPIC and t channel flag supportNakidai
Yay, now there're topic!!
4 daysAdd SETHOSTNAME commandNakidai
Also remove hostname argument from the cli. It'd be better to have it in a config file rather than passing through an argument, it was like that since times config file didn't exist, but time has changed
4 daysAdd LIST commandNakidai
Though it's kinda basic, but still
4 daysFix loop in kick()Nakidai
Incrementing global count instead of i is a stupid mistake...
4 daysFlatten privmsg to a userNakidai
Version before works fine, but - Checking whether it's a client or not is redundant - writef() was inside the loop before the break; for no good reason
4 daysAdd support for n channel flagNakidai
It's a flag that restricts a set of users able to write to a channel to those who joined. If not, reply 442 is sent upon PRIVMSG
4 daysFix KICK permissionsNakidai
IRC operators should be able to change channel modes as well
4 daysAdd KICK commandNakidai
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]
6 daysFactor writechanf() calls out to a macroNakidai
As they will anyway repeat a lot of times, it's better to make a macro for that. Also now this look better and printing doesn't take too much attention within a block of logic
6 daysFix writechanf() in mode_channel()Nakidai
Well, prefix starts with a colon, yes...
7 daysAdd channel mode editing supportNakidai
Well, an oper should have some way to manage their channel :)
7 daysAdd authorization for mode_channel()Nakidai
User has to be authorized in order to be able to change channel's modes.
9 daysRefactor MODENakidai
MODE command is used to manage modes of both users and channels. But since these tasks are quite different it'd be nice to split them to not have an if statement whose both branches occupe whole function
10 daysAdd basic support for channel operNakidai
At least it is now set to a first user :D
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
11 daysFix linkingNakidai
CFLAGS is a *c*ompiler flags and thus are unneeded for linking, perhaps even harmful. LDLIBS are needed for linking as program can require some external libraries and those should be listed exactly here
11 daysFix some typesNakidai
- One is missing * - Second is missing s
11 daysFix UB with reply 461Nakidai
It requires a parameter command, but no caller provided it :/
11 daysAdd OPER/SETOPERNakidai
SETOPER is a command for config, OPER is the one to authorize a user
11 daysFix PRIVMSG/NOTICENakidai
It's incorrect to check for an uppercase letter on a lowercase string...
11 daysAdd NAMESNakidai
So not it can show who's on the channel, yay. Though, no showing ops
12 daysAllow lf as well as crlfNakidai
For configuration it's important to allow IRC messages to end with \n. This also fixes a TODO from a previous commit and allows to connect to ircd using netcat
12 daysAdd WHOIS and config parsingNakidai
Now users can query each other Plus, server info and creation date can be changed without recompiling using configuration file in IRC message format which is loaded on startup TODO: since readcfg uses IRC logic, handle() now should be able to deal with commands ending with simply \n
2026-02-01FixesNakidai
- Now code depends on config.h in Makefile - By default the smallest timeout is chosen for poll() - Somewhy there was sizeof(PEER_QUIT_MAX)...
2026-02-01Added copyright notice to the config.hNakidai
Well, example config values don't need licesing that much, but as every other file has that notice I think this one should have it as well
2026-02-01Enhance registration messagesNakidai
Now ircd responds with all replies up to 4 Plus memchr was wrong, yep
2026-02-01Update READMENakidai
It wasn't very accurate for this time
2026-02-01Add validationNakidai
Now there can't be single \r or \n in the message, erroneous nicks and channel names are rejected, and usernames are stripped on '@'
2026-02-01Fix all the warningsNakidai
The one in user.c is the funniest one
2026-02-01Refactor QUIT message sendingNakidai
After seeing same announcing code second time I decided it should be done before an actual quit in loop.c. Plus, channel exiting is now done in user_remove().
2026-02-01Add exiting from a channel in user_removeNakidai
I think it should guarantee that nothing will break, including chanels
2026-02-01Add ping systemNakidai
Now users will be kicked for inactivity o.o
2026-02-01Remove magic numbers from ircd.hNakidai
Also make a new file config.h for storing that stuff
2026-01-30Add PING command v0.1.0Nakidai
Then I should make some logic for pinging others...
2026-01-30Add support for NOTICENakidai
Well, it's the same as PRIVMSG but different name
2026-01-30Invert the logic in nick()Nakidai
Well... yes
2026-01-30Simplify join commandNakidai Perumenei
- Instead of checking users in the channel check user's channels - Ensure thing looks really dumb here, so remove it
2026-01-30Add nickname change announcementNakidai Perumenei
2026-01-30Add self announcingNakidai Perumenei
If user hasn't joined any channels, announcement still should be delivered to them
2026-01-30Move announcing code to writef.cNakidai Perumenei
Well, I guess that code is needed more then once, so it'll be good to move it to some function
2026-01-30Fix channel removeNakidai Perumenei
Channels are removed just like users, hence they have the same problem as users had before: when channel is removed, links to it must be updated. For users that was fixed[1], for users this commit provides the fix. [1] Commit where user quit was fixed - 63c0a8860459c0c9bf3b66d4d4ec631ece4bf56e
2026-01-30Add nickname checkingNakidai Perumenei
Yay, adding some validation to the data ^^
2026-01-30Speed up user removingNakidai
Now it's O(n) instead of O(n^2)