libpurple/protocols/ircv3/purpleircv3capabilities.h

Sun, 27 Aug 2023 03:50:41 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 27 Aug 2023 03:50:41 -0500
changeset 42294
462317d1382d
parent 42287
8fc84ffcdcb2
child 42333
a34601ac633c
permissions
-rw-r--r--

IRCv3: add support for the server-time capability

This is a straight forward capability where the server will send a message tag
named "tag" with messages at it's discrection. This can include all IRC
messages include PRIVMSG, JOIN, etc.

https://ircv3.net/specs/extensions/server-time

Testing Done:
Connected to a local ergo server and sent some messages from pidgin2 to pidgin3 and verified the timestamp was set properly.

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

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
42294
462317d1382d IRCv3: add support for the server-time capability
Gary Kramlich <grim@reaperworld.com>
parents: 42287
diff changeset
42 /* https://ircv3.net/specs/extensions/server-time */
462317d1382d IRCv3: add support for the server-time capability
Gary Kramlich <grim@reaperworld.com>
parents: 42287
diff changeset
43 #define PURPLE_IRCV3_CAPABILITY_SERVER_TIME "server-time"
462317d1382d IRCv3: add support for the server-time capability
Gary Kramlich <grim@reaperworld.com>
parents: 42287
diff changeset
44
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 #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
46 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
47 PURPLE_IRCV3, CAPABILITIES, GObject)
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 #include "purpleircv3connection.h"
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50
42229
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 * purple_ircv3_capabilities_register: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
53 * @plugin: The [class@GPlugin.NativePlugin] instance.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
54 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
55 * Dynamically registers the PurpleIRCv3Capabilities type.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
56 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
57 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42055
diff changeset
58 */
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 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
60
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 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
62
41954
558106ebf999 Various clean ups to the IRCv3 connection process
Gary Kramlich <grim@reaperworld.com>
parents: 41951
diff changeset
63 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
64
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 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
66
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 * purple_ircv3_capabilities_get_connection:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 * 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
72 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 * Returns: (transfer none): The connection instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * Since: 3.0.0
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 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
78
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 /**
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * purple_ircv3_capabilities_request:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 * @capability: The capabilities to request.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 * 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
85 * `::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
86 * that was passed in here.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * Since: 3.0.0
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 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
91
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 /**
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * purple_ircv3_capabilities_lookup:
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 * @capabilities: The instance.
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 * @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
96 * @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
97 * capability was advertised or not.
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 * 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
100 * 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
101 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 * 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
103 *
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 * Since: 3.0.0
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 */
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 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
107
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
108 /**
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
109 * 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
110 * @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
111 * @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
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 * 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
114 * 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
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 * 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
117 * [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
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 * 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
120 * 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
121 *
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 * 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
123 *
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 * 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
125 */
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
126 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
127
2f5bbcc91854 IRCv3: Negotiate the message-tags capability and make sure our regex matches the BNF
Gary Kramlich <grim@reaperworld.com>
parents: 42006
diff changeset
128 /**
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
129 * 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
130 * @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
131 *
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 * 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
133 * 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
134 * 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
135 *
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 * 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
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 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
139
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 * 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
142 * @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
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 * 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
145 * 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
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 * 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
148 * 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
149 *
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 * 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
151 */
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
152 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
153
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
154 G_END_DECLS
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
155
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
156 #endif /* PURPLE_IRCV3_CAPABILITIES_H */

mercurial