Tue, 12 Dec 2023 03:48:15 -0600
Add birb as a subproject and make IRCv3 use it
Testing Done:
Connected an IRCv3 account to twitch without issue.
Reviewed at https://reviews.imfreedom.org/r/2877/
|
42530
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * This program is free software; you can redistribute it and/or modify |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation; either version 2 of the License, or |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
16 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
17 | */ |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | #if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \ |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | !defined(PURPLE_IRCV3_COMPILATION) |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
20 | # error "only <libpurple/protocols/ircv3.h> may be included directly" |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | #endif |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_IRCV3_CTCP_H |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #define PURPLE_IRCV3_CTCP_H |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include <glib-object.h> |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | #include <purple.h> |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | #include "purpleircv3connection.h" |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | G_BEGIN_DECLS |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | /** |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | * purple_ircv3_ctcp_handle: (skip) |
|
42543
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
37 | * @connection: The connection. |
|
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
38 | * @conversation: The conversation. |
|
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
39 | * @message: The message. |
|
42530
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | * |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | * Check if @message is a CTCP message and handles it accordingly. |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | * |
|
42543
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
43 | * Returns: %TRUE if the message was a CTCP message and %FALSE otherwise. |
|
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
44 | * |
|
42530
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | * Since: 3.0.0 |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | */ |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | G_GNUC_INTERNAL |
|
42543
6dcf672547fe
IRCv3: Update the signals so that handlers can inhibit the message from being displayed
Gary Kramlich <grim@reaperworld.com>
parents:
42530
diff
changeset
|
48 | gboolean purple_ircv3_ctcp_handle(PurpleIRCv3Connection *connection, PurpleConversation *conversation, PurpleMessage *message); |
|
42530
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | |
|
42544
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
50 | /** |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
51 | * purple_ircv3_ctcp_add_default_handlers: (skip) |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
52 | * @connection: The connection. |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
53 | * |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
54 | * Adds handlers for the CTCP commands that we support directly. |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
55 | * |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
56 | * Since: 3.0.0 |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
57 | */ |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
58 | G_GNUC_INTERNAL |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
59 | void purple_ircv3_ctcp_add_default_handlers(PurpleIRCv3Connection *connection); |
|
95d36c221e21
Implement CTCP ACTION and VERSION
Gary Kramlich <grim@reaperworld.com>
parents:
42543
diff
changeset
|
60 | |
|
42530
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | G_END_DECLS |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | |
|
55b30ce86f17
IRCv3: Implement basic CTCP support
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | #endif /* PURPLE_IRCV3_CTCP_H */ |