charybdis-ircd / charybdis

Scalable IRCv3.2 server for large, community-oriented networks
GNU General Public License v2.0
231 stars 102 forks source link

Added fakechannels to /LIST #271

Closed ManiacTwister closed 5 years ago

ManiacTwister commented 5 years ago

With this patch the /LIST command returns a list of configurable fake channels for a configurable timespan after connect.

ManiacTwister commented 5 years ago

@aaronmdjones thanks for your feedback, it think i've fixed everything you mentioned. Let me know if i should squash the commits

aaronmdjones commented 5 years ago

My last remaining concern is that topic is not handled properly. It appears to be possible to leak (if you provide a topic but not a name, then the containing structure will be freed without the topic pointer being freed), and if you do the opposite (provide a name but not a topic), rb_free() will be called on a pointer to a static string (""), which is definitely wrong.

My advice is to initially set the topic to NULL, do a rb_free() on it if no name was provided, and set it to "" if it is still NULL (EDIT: set it to rb_strdup("") if it is still NULL), just before calling irc_dictionary_add().

aaronmdjones commented 5 years ago

Scratch that last advice. Set it to rb_strdup("").

aaronmdjones commented 5 years ago

Merged.