ojii/txircd — pull request #6 by ElementalAlchemist (2012-09-15 19:30:38+00:00)
Title: Prefixes/Statuses

Its absence was annoying me, so I decided to implement the op-on-create feature of channels. As it turned out, that meant I had to implement prefixes at all.

I've opted for now to add a field ("prefixes") to the user data within the channel data, which holds prefixes held by that user on the channel. I figure we can change it later if it's convenient enough to do it some other way. It's implemented as a list, of course, because users can have multiple statuses simultaneously (e.g. +oh ElementalAlchemist ElementalAlchemist, which doesn't matter immediately, but if I later get a -o ElementalAlchemist, I should still have the halfop level).

Doing this also meant that I had to implement status symbols in the NAMES reply. This is that big chunk of changed code. I'm not sure if there's a better way to do that currently, but it currently works. Please comment on this bit and I'll do it better next time.

I've also barely slightly started implementing CAP, because that ties into this. We don't actually have to finish it if we don't have time, but it was simple enough to just throw it in now, and it'll probably save us some trouble later if/when we actually implement CAP. (By "barely slightly stared implementing," read "I've added some storage space for it, but none of the user interface is in yet.")