libpurple/protocols/ircv3/purpleircv3capabilities.h

Mon, 21 Aug 2023 23:36:42 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 21 Aug 2023 23:36:42 -0500
changeset 42287
8fc84ffcdcb2
parent 42229
605f8cba9704
child 42294
462317d1382d
permissions
-rw-r--r--

IRCv3: Use constants for capability names

This gives us one place to look at for our capability support.

Testing Done:
Connected an IRCv3 account with SASL without issue.

Reviewed at https://reviews.imfreedom.org/r/2580/

41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (at your option) any later version.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU General Public License for more details.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
18 #if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
19 !defined(PURPLE_IRCV3_COMPILATION)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
20 # error "only <libpurple/protocols/ircv3.h> may be included directly"
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
21 #endif
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #ifndef PURPLE_IRCV3_CAPABILITIES_H
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_IRCV3_CAPABILITIES_H
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include <glib.h>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <glib-object.h>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <gplugin.h>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <gplugin-native.h>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <purple.h>
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 G_BEGIN_DECLS
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35
42287
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
36 /* https://ircv3.net/specs/extensions/capability-negotiation */
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
37 #define PURPLE_IRCV3_CAPABILITY_CAP_LS_VERSION "302"
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
38
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
39 /* https://ircv3.net/specs/extensions/sasl-3.2 */
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
40 #define PURPLE_IRCV3_CAPABILITY_SASL "sasl"
8fc84ffcdcb2 IRCv3: Use constants for capability names
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
41
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 #define PURPLE_IRCV3_TYPE_CAPABILITIES (purple_ircv3_capabilities_get_type())
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 G_DECLARE_FINAL_TYPE(PurpleIRCv3Capabilities, purple_ircv3_capabilities,
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 PURPLE_IRCV3, CAPABILITIES, GObject)
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 #include "purpleircv3connection.h"
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
48 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
49 * purple_ircv3_capabilities_register: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
50 * @plugin: The [class@GPlugin.NativePlugin] instance.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
51 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
52 * Dynamically registers the PurpleIRCv3Capabilities type.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
53 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
54 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
55 */
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 G_GNUC_INTERNAL void purple_ircv3_capabilities_register(GPluginNativePlugin *plugin);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 G_GNUC_INTERNAL PurpleIRCv3Capabilities *purple_ircv3_capabilities_new(PurpleIRCv3Connection *connection);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59
41954
558106ebf999 Various clean ups to the IRCv3 connection process
Gary Kramlich <grim@reaperworld.com>
parents: 41951
diff changeset
60 G_GNUC_INTERNAL void purple_ircv3_capabilities_start(PurpleIRCv3Capabilities *capabilities);
558106ebf999 Various clean ups to the IRCv3 connection process
Gary Kramlich <grim@reaperworld.com>
parents: 41951
diff changeset
61
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 G_GNUC_INTERNAL gboolean purple_ircv3_capabilities_message_handler(GHashTable *tags, const char *source, const char *command, guint n_params, GStrv params, GError **error, gpointer data);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 /**
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 * purple_ircv3_capabilities_get_connection:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 * Gets the PurpleIRCv3Connection object that @capabilities was created with.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 * Returns: (transfer none): The connection instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * Since: 3.0.0
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 */
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 PurpleIRCv3Connection *purple_ircv3_capabilities_get_connection(PurpleIRCv3Capabilities *capabilities);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 /**
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 * purple_ircv3_capabilities_request:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * @capability: The capabilities to request.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * This method will send `CAP REQ @capability` to the server. Listen to the
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * `::ack` and `::nak` signals which will contain the contents of @capability
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 * that was passed in here.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 * Since: 3.0.0
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 */
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 void purple_ircv3_capabilities_request(PurpleIRCv3Capabilities *capabilities, const char *capability);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 /**
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * purple_ircv3_capabilities_lookup:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 * @name: The name of the capability to look for.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * @found: (out) (nullable): A return address for a boolean on whether the
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 * capability was advertised or not.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 * Gets the value that the @name capability provided if it was advertised. To
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 * determine if the capability was advertised use the @found parameter.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 * Returns: The value of the capability named @name.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 * Since: 3.0.0
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 */
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 const char *purple_ircv3_capabilities_lookup(PurpleIRCv3Capabilities *capabilities, const char *name, gboolean *found);
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104
42006
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
105 /**
42055
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
106 * purple_ircv3_capabilities_lookup_and_request:
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
107 * @capabilities: The instance.
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
108 * @name: The name of the capability to look for.
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
109 *
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
110 * A helper function to call [method@PurpleIRCv3.Capabilities.Lookup] and if
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
111 * found, call [method@PurpleIRCv3.Capabilities.Request].
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
112 *
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
113 * This method ignores the advertised value, so to get that you'll need to call
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
114 * [method@PurpleIRCv3.Capabilities.Lookup] yourself.
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
115 *
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
116 * Also if you need to do something when the server ACK's or NAK's your
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
117 * request, you're probably better off just using the methods yourself.
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
118 *
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
119 * Returns: %TRUE if @name was found and requested, %FALSE otherwise.
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
120 *
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
121 * Since: 3.0.0
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
122 */
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
123 gboolean purple_ircv3_capabilities_lookup_and_request(PurpleIRCv3Capabilities *capabilities, const char *name);
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
124
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
125 /**
42006
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
126 * purple_ircv3_capabilties_add_wait:
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
127 * @capabilities: The instance.
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
128 *
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
129 * Adds a wait counter to @capabilities. This counter is used to delay the
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
130 * call of `CAP END` until all capability negotiation has completed. This is
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
131 * necessary for SASL and may be necessary for other capabilities as well.
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
132 *
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
133 * Since: 3.0.0
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
134 */
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
135 void purple_ircv3_capabilities_add_wait(PurpleIRCv3Capabilities *capabilities);
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
136
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
137 /**
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
138 * purple_ircv3_capabilties_remove_wait:
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
139 * @capabilities: The instance.
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
140 *
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
141 * Removes a wait counter from @capabilities. Only when this counter reaches 0,
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
142 * will `CAP END` be called and registration completed.
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
143 *
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
144 * This is necessary for SASL and may be necessary for other capabilities as
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
145 * well.
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
146 *
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
147 * Since: 3.0.0
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
148 */
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
149 void purple_ircv3_capabilities_remove_wait(PurpleIRCv3Capabilities *capabilities);
d3c594113fe1 Add an atomic reference counters to the IRCv3 capabilities to track when we're done with negotiation
Gary Kramlich <grim@reaperworld.com>
parents: 41954
diff changeset
150
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
151 G_END_DECLS
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
152
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
153 #endif /* PURPLE_IRCV3_CAPABILITIES_H */

mercurial