libpurple/protocols/ircv3/purpleircv3connection.h

Thu, 30 Nov 2023 22:38:54 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 30 Nov 2023 22:38:54 -0600
changeset 42530
55b30ce86f17
parent 42513
482ba61e5123
child 42542
1407a0aac0bf
permissions
-rw-r--r--

IRCv3: Implement basic CTCP support

This is just the scaffolding for it and doesn't implement any actual commands.

Testing Done:
Sent some `CTCP VERSION`'s to an IRCv3 account. Also manually sent `CTCP VERSION`'s to users and channel via temporary code in when the connection was fully established.

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

41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (at your option) any later version.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU General Public License for more details.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
18 #if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
19 !defined(PURPLE_IRCV3_COMPILATION)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
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: 42220
diff changeset
21 #endif
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #ifndef PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include <glib.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <glib-object.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <gplugin.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <gplugin-native.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <purple.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
34 #include "purpleircv3version.h"
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
35
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 G_BEGIN_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #define PURPLE_IRCV3_TYPE_CONNECTION (purple_ircv3_connection_get_type())
42474
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
39
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
40 PURPLE_IRCV3_AVAILABLE_IN_ALL
42030
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
41 G_DECLARE_DERIVABLE_TYPE(PurpleIRCv3Connection, purple_ircv3_connection,
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
42 PURPLE_IRCV3, CONNECTION, PurpleConnection)
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
44 #include "purpleircv3capabilities.h"
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
45 #include "purpleircv3message.h"
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
46
42030
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
47 struct _PurpleIRCv3ConnectionClass {
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
48 /*< private >*/
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
49 PurpleConnectionClass parent;
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
50
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
51 /*< private >*/
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
52 gpointer reserved[8];
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
53 };
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
54
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
55 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
56 * purple_ircv3_connection_register: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
57 * @plugin: The GTypeModule
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
58 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
59 * Registers the dynamic type using @plugin.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
60 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
61 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
62 */
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 G_GNUC_INTERNAL void purple_ircv3_connection_register(GPluginNativePlugin *plugin);
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
65 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
66 * purple_ircv3_connection_get_cancellable: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
67 * @connection: The instance.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
68 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
69 * This is a private method that is not exposed externally.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
70 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
71 * Gets the cancellable for @connection.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
72 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
73 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
74 */
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 G_GNUC_INTERNAL GCancellable *purple_ircv3_connection_get_cancellable(PurpleIRCv3Connection *connection);
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
42000
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
77 /**
42530
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
78 * purple_ircv3_connection_emit_ctcp_request:
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
79 * @connection: The instance.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
80 * @command: The CTCP command.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
81 * @parameters: (nullable): The CTCP parameters.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
82 *
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
83 * Emits the [signal@Connection:ctcp-request] signal with the given @command
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
84 * and @parameters.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
85 *
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
86 * Since: 3.0.0
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
87 */
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
88 G_GNUC_INTERNAL void purple_ircv3_connection_emit_ctcp_request(PurpleIRCv3Connection *connection, const char *command, const char *parameters);
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
89
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
90 /**
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
91 * purple_ircv3_connection_emit_ctcp_response:
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
92 * @connection: The instance.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
93 * @command: The CTCP command.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
94 * @parameters: (nullable): The CTCP parameters.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
95 *
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
96 * Emits the [signal@Connection:ctcp-response] signal with the given @command
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
97 * and @parameters.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
98 *
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
99 * Since: 3.0.0
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
100 */
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
101 G_GNUC_INTERNAL void purple_ircv3_connection_emit_ctcp_response(PurpleIRCv3Connection *connection, const char *command, const char *parameters);
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
102
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
103 /**
42000
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
104 * purple_ircv3_connection_writef:
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
105 * @connection: The instance.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
106 * @format: The format string.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
107 * @...: The arguments for @format.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
108 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
109 * Similar to C `printf()` but writes the format string out to @connection.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
110 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
111 * This will add the proper line termination, so you do not need to worry about
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
112 * that.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
113 */
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
114 void purple_ircv3_connection_writef(PurpleIRCv3Connection *connection, const char *format, ...) G_GNUC_PRINTF(2, 3);
41793
2e6f09066f94 Add connection registration to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 41783
diff changeset
115
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
116 /**
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
117 * purple_ircv3_connection_get_capabilities:
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
118 * @connection: The instance.
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
119 *
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
120 * Gets the list of capabilities that the server supplied during registration.
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
121 *
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
122 * Returns: (transfer none): The list of capabilities that the server supports.
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
123 */
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
124 PurpleIRCv3Capabilities *purple_ircv3_connection_get_capabilities(PurpleIRCv3Connection *connection);
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
125
42013
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
126 /**
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
127 * purple_ircv3_connection_get_registered:
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
128 * @connection: The instance.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
129 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
130 * Gets whether or not the connection has finished the registration process.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
131 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
132 * Returns: %TRUE if registration has been completed otherwise %FALSE.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
133 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
134 * Since: 3.0.0
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
135 */
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
136 PURPLE_IRCV3_AVAILABLE_IN_ALL
42013
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
137 gboolean purple_ircv3_connection_get_registered(PurpleIRCv3Connection *connection);
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
138
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
139 /**
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
140 * purple_ircv3_connection_add_status_message:
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
141 * @connection: The instance.
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
142 * @message: The message.
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
143 *
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
144 * Adds a message to the status conversation/window for @connection.
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
145 *
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
146 * Since: 3.0.0
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
147 */
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
148 PURPLE_IRCV3_AVAILABLE_IN_ALL
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
149 void purple_ircv3_connection_add_status_message(PurpleIRCv3Connection *connection, PurpleIRCv3Message *message);
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
150
42494
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
151 /**
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
152 * purple_ircv3_connection_is_channel:
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
153 * @connection: The instance.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
154 * @id: The id to check.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
155 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
156 * Checks if @id is a channel.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
157 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
158 * Right now this just checks if @id starts with a `#` but in the future this
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
159 * will be updated to check all channel prefixes that the connection supports.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
160 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
161 * Returns: %TRUE if @id is a channel otherwise %FALSE.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
162 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
163 * Since: 3.0.0
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
164 */
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
165 PURPLE_IRCV3_AVAILABLE_IN_ALL
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
166 gboolean purple_ircv3_connection_is_channel(PurpleIRCv3Connection *connection, const char *id);
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
167
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
168 /**
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
169 * purple_ircv3_connection_find_or_create_conversation:
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
170 * @connection: The instance.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
171 * @id: The id of the conversation.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
172 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
173 * Looks for an existing conversation belonging to @connection and returns it
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
174 * if found. If not found a new conversation will be created.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
175 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
176 * This will only ever return %NULL if @connection is invalid or @id is %NULL.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
177 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
178 * Note that ownership of the conversation remains with the default
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
179 * [class@Purple.ConversationManager].
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
180 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
181 * Returns: (transfer none) (nullable): The conversation.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
182 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
183 * Since: 3.0.0
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
184 */
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
185 PURPLE_IRCV3_AVAILABLE_IN_ALL
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
186 PurpleConversation *purple_ircv3_connection_find_or_create_conversation(PurpleIRCv3Connection *connection, const char *id);
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
187
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
188 /**
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
189 * purple_ircv3_connection_find_or_create_contact:
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
190 * @connection: The instance.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
191 * @nick: The nickname of the user.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
192 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
193 * Looks for an existing contact belonging to @connection and returns it if
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
194 * found. If not a new contact will be created.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
195 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
196 * This will only ever return %NULL if @connection is invalid or @nick is
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
197 * %NULL.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
198 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
199 * Note that the ownership of the contact remains with the default
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
200 * [class@Purple.ContactManager].
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
201 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
202 * Returns: (transfer none) (nullable): The contact.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
203 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
204 * Since: 3.0.0
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
205 */
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
206 PURPLE_IRCV3_AVAILABLE_IN_ALL
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
207 PurpleContact *purple_ircv3_connection_find_or_create_contact(PurpleIRCv3Connection *connection, const char *nick);
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
208
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
209 G_END_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
210
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
211 #endif /* PURPLE_IRCV3_CONNECTION_H */

mercurial