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/
|
41750
7ab7d79ac0c5
Create a skeleton for the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | IRCV3_SOURCES = [ |
|
43097
757575456cc2
IRCv3: Implement the query command
Gary Kramlich <grim@reaperworld.com>
parents:
43024
diff
changeset
|
2 | 'purpleircv3commands.c', |
|
41783
5ea6c18ef7a8
Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41774
diff
changeset
|
3 | 'purpleircv3connection.c', |
|
41916
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
4 | 'purpleircv3core.c', |
|
42937
34ac8ac8c7b6
Implement CTCP VERSION response
Gary Kramlich <grim@reaperworld.com>
parents:
42925
diff
changeset
|
5 | 'purpleircv3ctcphandlers.c', |
|
41916
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
6 | 'purpleircv3messagehandlers.c', |
|
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
7 | 'purpleircv3protocol.c', |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42229
diff
changeset
|
8 | 'purpleircv3protocolconversation.c', |
|
41916
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
9 | ] |
|
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
10 | |
|
4ee9cb957595
Implement sending im's for IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41822
diff
changeset
|
11 | IRCV3_HEADERS = [ |
|
43097
757575456cc2
IRCv3: Implement the query command
Gary Kramlich <grim@reaperworld.com>
parents:
43024
diff
changeset
|
12 | 'purpleircv3commands.h', |
|
41783
5ea6c18ef7a8
Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
41774
diff
changeset
|
13 | 'purpleircv3connection.h', |
|
41774
170078e728c0
Implement a parser for ircv3 and add unit tests to it.
Gary Kramlich <grim@reaperworld.com>
parents:
41750
diff
changeset
|
14 | 'purpleircv3core.h', |
|
42937
34ac8ac8c7b6
Implement CTCP VERSION response
Gary Kramlich <grim@reaperworld.com>
parents:
42925
diff
changeset
|
15 | 'purpleircv3ctcphandlers.h', |
|
41796
ebe4ff278b02
Use the parser on ircv3 messages and handle pings
Gary Kramlich <grim@reaperworld.com>
parents:
41783
diff
changeset
|
16 | 'purpleircv3messagehandlers.h', |
|
41750
7ab7d79ac0c5
Create a skeleton for the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | 'purpleircv3protocol.h', |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42229
diff
changeset
|
18 | 'purpleircv3protocolconversation.h', |
|
41750
7ab7d79ac0c5
Create a skeleton for the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | ] |
|
7ab7d79ac0c5
Create a skeleton for the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | |
|
42229
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
21 | if not DYNAMIC_IRCV3 |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
22 | subdir_done() |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
23 | endif |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
24 | |
|
43212
d2f7c939f650
IRCv3: Handle incoming formatting
Gary Kramlich <grim@reaperworld.com>
parents:
43199
diff
changeset
|
25 | ibis_dep = dependency('ibis', version : '>= 0.13.1') |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42652
diff
changeset
|
26 | |
|
42969
4132f4d92fd7
Change the version to 2.90.0 to let us do proper releases
Gary Kramlich <grim@reaperworld.com>
parents:
42942
diff
changeset
|
27 | ircv3_filebase = f'purple-@purple_api_major_version@-ircv3' |
|
4132f4d92fd7
Change the version to 2.90.0 to let us do proper releases
Gary Kramlich <grim@reaperworld.com>
parents:
42942
diff
changeset
|
28 | ircv3_filebase = f'purple-@purple_api_major_version@-ircv3' |
|
42229
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
29 | |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
30 | ircv3_includes = include_directories('.') |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
31 | ircv3_include_base = purple_include_base / 'protocols/ircv3' |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
32 | |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
33 | |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
34 | ircv3_resources = gnome.compile_resources('ircv3resource', |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
35 | 'resources/ircv3.gresource.xml', |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
36 | source_dir : 'resources', |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
37 | c_name : 'purple_ircv3') |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
38 | IRCV3_SOURCES += ircv3_resources |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
39 | |
|
42791
250ab0bca4e3
IRCv3: Remove all the development stuff
Gary Kramlich <grim@reaperworld.com>
parents:
42786
diff
changeset
|
40 | shared_library('ircv3', IRCV3_SOURCES + IRCV3_HEADERS, |
|
42229
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
41 | c_args : ['-DPURPLE_IRCV3_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Purple-IRCv3"'], |
|
42472
409148c5c5b7
Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42372
diff
changeset
|
42 | gnu_symbol_visibility : 'hidden', |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42652
diff
changeset
|
43 | dependencies : [birb_dep, libpurple_dep, glib, gio, hasl, ibis_dep], |
|
42229
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
44 | install : true, |
|
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
45 | install_dir : PURPLE_PLUGINDIR) |
|
41750
7ab7d79ac0c5
Create a skeleton for the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | |
|
42229
605f8cba9704
Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents:
42081
diff
changeset
|
47 | devenv.append('PURPLE_PLUGIN_PATH', meson.current_build_dir()) |