protocols/ircv3/purpleircv3connection.h

Thu, 15 Aug 2024 21:26:18 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 15 Aug 2024 21:26:18 -0500
changeset 42879
dc1e61fb9f00
parent 42815
95bb2ae83de7
child 42896
5c8f4a455d3c
permissions
-rw-r--r--

Make PurpleIRCv3.Protocol and PurpleIRCv3.Connection Final

We're not supporting subclassing this anymore so this makes it really final.
Also had a few random tweaks along the way.

Testing Done:
Connected to a local ergo instance without issue.

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

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 *
42568
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
5 * Purple is the legal property of its developers, whose names are too numerous
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
7 * source distribution.
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
8 *
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
9 * This library is free software; you can redistribute it and/or modify
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * 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
11 * 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
12 * (at your option) any later version.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
42568
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
14 * This library is distributed in the hope that it will be useful,
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * 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
16 * 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
17 * GNU General Public License for more details.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
42568
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
20 * along with this library; if not, see <https://www.gnu.org/licenses/>.
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
42568
31e8c7c92e2f Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents: 42543
diff changeset
22
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
23 #if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
24 !defined(PURPLE_IRCV3_COMPILATION)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
25 # 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
26 #endif
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 #ifndef PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #define PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31 #include <glib.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <glib-object.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 #include <gplugin.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #include <gplugin-native.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 #include <purple.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
39 #include <ibis.h>
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
40
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
41 #include "purpleircv3version.h"
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
42
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 G_BEGIN_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 #define PURPLE_IRCV3_TYPE_CONNECTION (purple_ircv3_connection_get_type())
42474
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
46
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
47 PURPLE_IRCV3_AVAILABLE_IN_ALL
42879
dc1e61fb9f00 Make PurpleIRCv3.Protocol and PurpleIRCv3.Connection Final
Gary Kramlich <grim@reaperworld.com>
parents: 42815
diff changeset
48 G_DECLARE_FINAL_TYPE(PurpleIRCv3Connection, purple_ircv3_connection,
dc1e61fb9f00 Make PurpleIRCv3.Protocol and PurpleIRCv3.Connection Final
Gary Kramlich <grim@reaperworld.com>
parents: 42815
diff changeset
49 PURPLE_IRCV3, CONNECTION, PurpleConnection)
42030
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
50
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
51 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
52 * purple_ircv3_connection_register: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
53 * @plugin: The GTypeModule
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
54 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
55 * Registers the dynamic type using @plugin.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
56 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
57 * Since: 3.0
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
58 */
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 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
60
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
61 /**
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
62 * purple_ircv3_connection_get_client:
42530
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
63 * @connection: The instance.
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
64 *
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
65 * Gets the [class@Ibis.Client] from @connection.
42543
6dcf672547fe IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents: 42542
diff changeset
66 *
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
67 * Returns: (transfer none): The client instance if connected, otherwise %NULL.
42530
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
68 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
69 * Since: 3.0
42530
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
70 */
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
71 PURPLE_AVAILABLE_IN_3_0
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
72 IbisClient *purple_ircv3_connection_get_client(PurpleIRCv3Connection *connection);
42530
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
73
55b30ce86f17 IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents: 42513
diff changeset
74 /**
42000
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
75 * purple_ircv3_connection_writef:
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
76 * @connection: The instance.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
77 * @format: The format string.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
78 * @...: The arguments for @format.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
79 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
80 * 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
81 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
82 * 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
83 * that.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
84 */
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
85 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
86
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
87 /**
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
88 * 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
89 * @connection: The instance.
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
90 * @message: The message.
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
91 *
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
92 * 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
93 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
94 * Since: 3.0
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
95 */
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
96 PURPLE_IRCV3_AVAILABLE_IN_ALL
42769
c488d7af2923 Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents: 42652
diff changeset
97 void purple_ircv3_connection_add_status_message(PurpleIRCv3Connection *connection, IbisMessage *message);
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
98
42494
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
99 /**
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
100 * purple_ircv3_connection_is_channel:
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
101 * @connection: The instance.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
102 * @id: The id to check.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
103 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
104 * 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
105 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
106 * 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
107 * 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
108 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
109 * 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
110 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
111 * Since: 3.0
42494
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
112 */
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
113 PURPLE_IRCV3_AVAILABLE_IN_ALL
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
114 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
115
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
116 /**
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
117 * 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
118 * @connection: The instance.
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
119 * @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
120 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
121 * 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
122 * 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
123 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
124 * 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
125 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
126 * 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
127 * [class@Purple.ConversationManager].
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
128 *
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
129 * 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
130 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
131 * Since: 3.0
42494
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
132 */
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
133 PURPLE_IRCV3_AVAILABLE_IN_ALL
4d6baa511e52 IRCv3: create some helper functions for finding/creating conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42474
diff changeset
134 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
135
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
136 /**
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
137 * 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
138 * @connection: The instance.
42815
95bb2ae83de7 IRCv3: Use Ibis.Message in PurpleIRCv3.Connection.find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42769
diff changeset
139 * @message: The message to get the contact for.
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
140 *
42815
95bb2ae83de7 IRCv3: Use Ibis.Message in PurpleIRCv3.Connection.find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42769
diff changeset
141 * Looks for an existing contact from @message belonging to @connection and
95bb2ae83de7 IRCv3: Use Ibis.Message in PurpleIRCv3.Connection.find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42769
diff changeset
142 * returns it if found. If not a new contact will be created.
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
143 *
42815
95bb2ae83de7 IRCv3: Use Ibis.Message in PurpleIRCv3.Connection.find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42769
diff changeset
144 * This will only ever return %NULL if @connection is invalid or @message is
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
145 * %NULL.
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
146 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
147 * 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
148 * [class@Purple.ContactManager].
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
149 *
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
150 * 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
151 *
42619
3dd7cd0eabf1 Remove the micro version from Since tags in IRCv3 prpl
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42568
diff changeset
152 * Since: 3.0
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
153 */
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
154 PURPLE_IRCV3_AVAILABLE_IN_ALL
42815
95bb2ae83de7 IRCv3: Use Ibis.Message in PurpleIRCv3.Connection.find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42769
diff changeset
155 PurpleContact *purple_ircv3_connection_find_or_create_contact(PurpleIRCv3Connection *connection, IbisMessage *message);
42513
482ba61e5123 IRCv3: Add an ircv3_connection_find_or_create_contact
Gary Kramlich <grim@reaperworld.com>
parents: 42494
diff changeset
156
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157 G_END_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
158
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 #endif /* PURPLE_IRCV3_CONNECTION_H */

mercurial