Thu, 24 Apr 2025 22:19:39 -0500
IRCv3: check if a member is in a conversation before adding them
Awhile ago we update the NAMREPLY handler to build a separate
Purple.ConversationMembers and then splice that onto the existing one to help
with sorting and other performance issues. However, we didn't check if the
users already existed in the existing list, so we would get duplicates. This
address that.
Also fixed a reference leak.
Testing Done:
Joined a channel and sent `/quote names #channel` multiple times and verified that the member list did not grow to include a bunch of duplicates.
Reviewed at https://reviews.imfreedom.org/r/3987/
IRCV3_SOURCES = [ 'purpleircv3commands.c', 'purpleircv3connection.c', 'purpleircv3core.c', 'purpleircv3ctcphandlers.c', 'purpleircv3messagehandlers.c', 'purpleircv3protocol.c', 'purpleircv3protocolconversation.c', ] IRCV3_HEADERS = [ 'purpleircv3commands.h', 'purpleircv3connection.h', 'purpleircv3core.h', 'purpleircv3ctcphandlers.h', 'purpleircv3messagehandlers.h', 'purpleircv3protocol.h', 'purpleircv3protocolconversation.h', ] if not DYNAMIC_IRCV3 subdir_done() endif ibis_dep = dependency('ibis', version : '>= 0.13.1') ircv3_filebase = f'purple-@purple_api_major_version@-ircv3' ircv3_filebase = f'purple-@purple_api_major_version@-ircv3' ircv3_includes = include_directories('.') ircv3_include_base = purple_include_base / 'protocols/ircv3' ircv3_resources = gnome.compile_resources('ircv3resource', 'resources/ircv3.gresource.xml', source_dir : 'resources', c_name : 'purple_ircv3') IRCV3_SOURCES += ircv3_resources shared_library('ircv3', IRCV3_SOURCES + IRCV3_HEADERS, c_args : ['-DPURPLE_IRCV3_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRCv3"'], gnu_symbol_visibility : 'hidden', dependencies : [birb_dep, libpurple_dep, glib, gio, hasl, ibis_dep], install : true, install_dir : PURPLE_PLUGINDIR) devenv.append('PURPLE_PLUGIN_PATH', meson.current_build_dir())