Tue, 08 Apr 2025 23:20:52 -0500
IRCv3: Fix privmsg going to the status window before registration is complete
This got broken when some of this code was reorganized.
Testing Done:
Ran `ninja scan-build` and verified the error was gone. Also connected to libera and verified that I didn't get a conversation with the server's name anymore.
Reviewed at https://reviews.imfreedom.org/r/3963/
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
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:
42511
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:
42511
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:
42511
diff
changeset
|
7 | * source distribution. |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
8 | * |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
12 | * (at your option) any later version. |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
42568
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
17 | * GNU General Public License for more details. |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
42568
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
31e8c7c92e2f
Make sure all of the license headers for IRCv3 are GPLv2
Gary Kramlich <grim@reaperworld.com>
parents:
42511
diff
changeset
|
20 | * along with this library; if not, see <https://www.gnu.org/licenses/>. |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include <glib/gi18n-lib.h> |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
25 | #include <ibis.h> |
|
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
26 | |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | #include "purpleircv3protocolconversation.h" |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | #include "purpleircv3connection.h" |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
30 | #include "purpleircv3core.h" |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | /****************************************************************************** |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | * PurpleProtocolConversation Implementation |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | *****************************************************************************/ |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | static void |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | purple_ircv3_protocol_conversation_send_message_async(PurpleProtocolConversation *protocol, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | PurpleConversation *conversation, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | PurpleMessage *message, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | GCancellable *cancellable, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | GAsyncReadyCallback callback, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | gpointer data) |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | { |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | PurpleIRCv3Connection *v3_connection = NULL; |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | PurpleAccount *account = NULL; |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | PurpleConnection *connection = NULL; |
|
42933
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
46 | PurpleConversation *status_conversation = NULL; |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
47 | IbisClient *client = NULL; |
|
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
48 | IbisMessage *ibis_message = NULL; |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | GTask *task = NULL; |
|
43059
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
50 | const char *contents = NULL; |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | const char *id = NULL; |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | account = purple_conversation_get_account(conversation); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | connection = purple_account_get_connection(account); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | v3_connection = PURPLE_IRCV3_CONNECTION(connection); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | |
|
42933
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
57 | /* We ignore non commands to the status conversation. */ |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
58 | status_conversation = purple_ircv3_connection_get_status_conversation(v3_connection); |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
59 | if(conversation == status_conversation) { |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
60 | task = g_task_new(protocol, cancellable, callback, data); |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
61 | g_task_return_boolean(task, TRUE); |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
62 | g_clear_object(&task); |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
63 | |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
64 | return; |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
65 | } |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
66 | |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | id = purple_conversation_get_id(conversation); |
|
43059
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
68 | contents = purple_message_get_contents(message); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
69 | |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
70 | ibis_message = ibis_message_new(IBIS_MSG_PRIVMSG); |
|
43059
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
71 | if(purple_message_get_action(message)) { |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
72 | IbisCTCPMessage *ctcp_message = NULL; |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
73 | |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
74 | ibis_message_set_params(ibis_message, id, NULL); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
75 | |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
76 | ctcp_message = ibis_ctcp_message_new(IBIS_CTCP_ACTION); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
77 | ibis_ctcp_message_set_params(ctcp_message, contents, NULL); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
78 | ibis_message_set_ctcp_message(ibis_message, ctcp_message); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
79 | } else { |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
80 | ibis_message_set_params(ibis_message, id, contents, NULL); |
|
c574888ce9e2
IRCv3: Add support for sending CTCP ACTION
Gary Kramlich <grim@reaperworld.com>
parents:
43030
diff
changeset
|
81 | } |
|
42933
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
82 | |
|
4abacb3d5773
IRCv3: Don't send message that the user input into the status conversation
Gary Kramlich <grim@reaperworld.com>
parents:
42900
diff
changeset
|
83 | client = purple_ircv3_connection_get_client(v3_connection); |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
84 | ibis_client_write(client, ibis_message); |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | task = g_task_new(protocol, cancellable, callback, data); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | g_task_return_boolean(task, TRUE); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
88 | g_clear_object(&task); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
89 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
90 | /* This will be made conditional when we add echo-message support. |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
91 | * https://ircv3.net/specs/extensions/echo-message |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
92 | */ |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
93 | purple_conversation_write_message(conversation, message); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
94 | } |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
95 | |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | static gboolean |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | purple_ircv3_protocol_conversation_send_message_finish(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | GAsyncResult *result, |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | GError **error) |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | { |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
101 | return g_task_propagate_boolean(G_TASK(result), error); |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | } |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
104 | static PurpleChannelJoinDetails * |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
105 | purple_ircv3_protocol_conversation_get_channel_join_details(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
106 | G_GNUC_UNUSED PurpleAccount *account) |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
107 | { |
|
42799
8b06291db25c
Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents:
42769
diff
changeset
|
108 | return purple_channel_join_details_new(0, FALSE, 0, TRUE, 0); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
109 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
110 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
111 | static void |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
112 | purple_ircv3_protocol_conversation_join_channel_async(PurpleProtocolConversation *protocol, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
113 | PurpleAccount *account, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
114 | PurpleChannelJoinDetails* details, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
115 | GCancellable* cancellable, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
116 | GAsyncReadyCallback callback, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
117 | gpointer data) |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
118 | { |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
119 | PurpleIRCv3Connection *v3_connection = NULL; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
120 | PurpleConnection *connection = NULL; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
121 | PurpleConversation *conversation = NULL; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
122 | PurpleConversationManager *manager = NULL; |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
123 | IbisClient *client = NULL; |
|
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
124 | IbisMessage *message = NULL; |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
125 | GTask *task = NULL; |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
126 | char *normalized_name = NULL; |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
127 | const char *name = NULL; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
128 | const char *password = NULL; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
129 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
130 | connection = purple_account_get_connection(account); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
131 | v3_connection = PURPLE_IRCV3_CONNECTION(connection); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
132 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
133 | task = g_task_new(protocol, cancellable, callback, data); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
134 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
135 | /* Validate that the name isn't empty. */ |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
136 | /* TODO: check that name match the ISUPPORT channel prefixes. */ |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
137 | name = purple_channel_join_details_get_name(details); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
138 | if(purple_strempty(name)) { |
|
43183
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
139 | g_task_return_new_error_literal(task, PURPLE_IRCV3_DOMAIN, 0, |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
140 | _("channel name is empty")); |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
141 | g_clear_object(&task); |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
142 | |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
143 | return; |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
144 | } |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
145 | |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
146 | if(strchr(name, ',') != NULL) { |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
147 | g_task_return_new_error_literal(task, PURPLE_IRCV3_DOMAIN, 0, |
|
2d03fb0c0ff2
IRCv3: Return an error when trying to join multiple channels at once
Gary Kramlich <grim@reaperworld.com>
parents:
43148
diff
changeset
|
148 | _("only one channel may be joined at a time")); |
|
42450
bd1327c022d4
fix some memory leaks
Markus Fischer <ivanhoe@fiscari.de>
parents:
42378
diff
changeset
|
149 | g_clear_object(&task); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
150 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
151 | return; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
152 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
153 | |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
154 | client = purple_ircv3_connection_get_client(v3_connection); |
|
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
155 | normalized_name = ibis_client_normalize(client, name); |
|
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
156 | |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
157 | manager = purple_conversation_manager_get_default(); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
158 | conversation = purple_conversation_manager_find_with_id(manager, account, |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
159 | normalized_name); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
160 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
161 | /* If the conversation already exists, just return TRUE. */ |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
162 | if(PURPLE_IS_CONVERSATION(conversation)) { |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
163 | g_free(normalized_name); |
|
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
164 | |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
165 | g_task_return_boolean(task, TRUE); |
|
42450
bd1327c022d4
fix some memory leaks
Markus Fischer <ivanhoe@fiscari.de>
parents:
42378
diff
changeset
|
166 | g_clear_object(&task); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
167 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
168 | return; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
169 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
170 | |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
171 | message = ibis_message_new(IBIS_MSG_JOIN); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
172 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
173 | password = purple_channel_join_details_get_password(details); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
174 | if(!purple_strempty(password)) { |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
175 | ibis_message_set_params(message, normalized_name, password, NULL); |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
176 | } else { |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
177 | ibis_message_set_params(message, normalized_name, NULL); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
178 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
179 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
180 | conversation = g_object_new( |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
181 | PURPLE_TYPE_CONVERSATION, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
182 | "account", account, |
|
42653
584895b844d2
PurpleConversationType's values were pascal case when they should be upper snake case
Gary Kramlich <grim@reaperworld.com>
parents:
42652
diff
changeset
|
183 | "type", PURPLE_CONVERSATION_TYPE_CHANNEL, |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
184 | "id", normalized_name, |
|
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
185 | "title", name, |
|
43098
13b0954a268b
IRCv3: Fix kick detection and handle online conversation states
Gary Kramlich <grim@reaperworld.com>
parents:
43059
diff
changeset
|
186 | "online", TRUE, |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
187 | NULL); |
|
43030
97ed7473351f
Update the protocols for the ConversationManager deprecations
Gary Kramlich <grim@reaperworld.com>
parents:
43022
diff
changeset
|
188 | purple_conversation_manager_add(manager, conversation); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
189 | g_clear_object(&conversation); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
190 | |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
191 | ibis_client_write(client, message); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
192 | |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
193 | g_free(normalized_name); |
|
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
194 | |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
195 | g_task_return_boolean(task, TRUE); |
|
42450
bd1327c022d4
fix some memory leaks
Markus Fischer <ivanhoe@fiscari.de>
parents:
42378
diff
changeset
|
196 | g_clear_object(&task); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
197 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
198 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
199 | static gboolean |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
200 | purple_ircv3_protocol_conversation_join_channel_finish(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
201 | GAsyncResult *result, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
202 | GError **error) |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
203 | { |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
204 | return g_task_propagate_boolean(G_TASK(result), error); |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
205 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
206 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
207 | static void |
|
42900
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
208 | purple_ircv3_protocol_conversation_leave_conversation_async(PurpleProtocolConversation *protocol, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
209 | PurpleConversation *conversation, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
210 | GCancellable *cancellable, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
211 | GAsyncReadyCallback callback, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
212 | gpointer data) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
213 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
214 | GTask *task = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
215 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
216 | if(purple_conversation_is_channel(conversation)) { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
217 | PurpleIRCv3Connection *v3_connection = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
218 | PurpleAccount *account = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
219 | PurpleConnection *connection = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
220 | IbisClient *client = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
221 | IbisMessage *message = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
222 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
223 | account = purple_conversation_get_account(conversation); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
224 | connection = purple_account_get_connection(account); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
225 | v3_connection = PURPLE_IRCV3_CONNECTION(connection); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
226 | client = purple_ircv3_connection_get_client(v3_connection); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
227 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
228 | message = ibis_message_new(IBIS_MSG_PART); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
229 | ibis_message_set_params(message, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
230 | purple_conversation_get_id(conversation), |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
231 | NULL); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
232 | ibis_client_write(client, message); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
233 | } |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
234 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
235 | task = g_task_new(protocol, cancellable, callback, data); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
236 | g_task_set_source_tag(task, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
237 | purple_ircv3_protocol_conversation_leave_conversation_async); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
238 | g_task_return_boolean(task, TRUE); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
239 | g_clear_object(&task); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
240 | } |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
241 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
242 | static gboolean |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
243 | purple_ircv3_protocol_conversation_leave_conversation_finish(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
244 | GAsyncResult *result, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
245 | GError **error) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
246 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
247 | g_return_val_if_fail(G_IS_ASYNC_RESULT(result), FALSE); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
248 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
249 | if(!g_async_result_is_tagged(result, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
250 | purple_ircv3_protocol_conversation_leave_conversation_async)) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
251 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
252 | g_set_error_literal(error, PURPLE_IRCV3_DOMAIN, 0, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
253 | "result has unexpected tag"); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
254 | return FALSE; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
255 | } |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
256 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
257 | return g_task_propagate_boolean(G_TASK(result), error); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
258 | } |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
259 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
260 | static void |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
261 | purple_ircv3_protocol_conversation_send_typing(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
262 | PurpleConversation *conversation, |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
263 | PurpleTypingState state) |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
264 | { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
265 | PurpleIRCv3Connection *connection; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
266 | PurpleAccount *account = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
267 | PurpleConnection *purple_connection = NULL; |
|
43124
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
268 | PurpleConversation *status_conversation = NULL; |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
269 | IbisClient *client = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
270 | IbisMessage *message = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
271 | IbisTags *tags = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
272 | const char *value = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
273 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
274 | if(state == PURPLE_TYPING_STATE_TYPING) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
275 | value = IBIS_TYPING_ACTIVE; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
276 | } else if(state == PURPLE_TYPING_STATE_PAUSED) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
277 | value = IBIS_TYPING_PAUSED; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
278 | } else if(state == PURPLE_TYPING_STATE_NONE) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
279 | value = IBIS_TYPING_DONE; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
280 | } |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
281 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
282 | if(value == NULL) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
283 | return; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
284 | } |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
285 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
286 | account = purple_conversation_get_account(conversation); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
287 | purple_connection = purple_account_get_connection(account); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
288 | connection = PURPLE_IRCV3_CONNECTION(purple_connection); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
289 | |
|
43124
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
290 | status_conversation = purple_ircv3_connection_get_status_conversation(connection); |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
291 | if(conversation == status_conversation) { |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
292 | return; |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
293 | } |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
294 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
295 | message = ibis_message_new(IBIS_MSG_TAGMSG); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
296 | ibis_message_set_params(message, purple_conversation_get_id(conversation), |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
297 | NULL); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
298 | |
|
43022
567e86fd4234
IRCv3: Fix an ibis deprecation
Gary Kramlich <grim@reaperworld.com>
parents:
42933
diff
changeset
|
299 | tags = ibis_message_get_tags(message); |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
300 | ibis_tags_add(tags, IBIS_TAG_TYPING, value); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
301 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
302 | client = purple_ircv3_connection_get_client(connection); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
303 | ibis_client_write(client, message); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
304 | } |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
305 | |
|
43105
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
306 | static void |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
307 | purple_ircv3_protocol_conversation_refresh(G_GNUC_UNUSED PurpleProtocolConversation *protocol, |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
308 | PurpleConversation *conversation) |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
309 | { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
310 | PurpleIRCv3Connection *connection; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
311 | PurpleAccount *account = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
312 | PurpleConnection *purple_connection = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
313 | IbisClient *client = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
314 | IbisMessage *message = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
315 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
316 | if(purple_conversation_get_online(conversation)) { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
317 | return; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
318 | } |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
319 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
320 | if(!purple_conversation_is_channel(conversation)) { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
321 | /* We need to mark DM's as online again. */ |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
322 | purple_conversation_set_online(conversation, TRUE); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
323 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
324 | return; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
325 | } |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
326 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
327 | account = purple_conversation_get_account(conversation); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
328 | purple_connection = purple_account_get_connection(account); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
329 | connection = PURPLE_IRCV3_CONNECTION(purple_connection); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
330 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
331 | message = ibis_message_new(IBIS_MSG_JOIN); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
332 | ibis_message_set_params(message, purple_conversation_get_id(conversation), |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
333 | NULL); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
334 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
335 | client = purple_ircv3_connection_get_client(connection); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
336 | ibis_client_write(client, message); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
337 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
338 | /* TODO: We need to validate the JOIN by handling the join from the server, |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
339 | * but right now we just assume it was successful. |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
340 | */ |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
341 | purple_conversation_set_online(conversation, TRUE); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
342 | } |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
343 | |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
344 | void |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
345 | purple_ircv3_protocol_conversation_init(PurpleProtocolConversationInterface *iface) { |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
346 | iface->send_message_async = |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
347 | purple_ircv3_protocol_conversation_send_message_async; |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
348 | iface->send_message_finish = |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
349 | purple_ircv3_protocol_conversation_send_message_finish; |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
350 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
351 | iface->get_channel_join_details = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
352 | purple_ircv3_protocol_conversation_get_channel_join_details; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
353 | iface->join_channel_async = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
354 | purple_ircv3_protocol_conversation_join_channel_async; |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
355 | iface->join_channel_finish = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
356 | purple_ircv3_protocol_conversation_join_channel_finish; |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
357 | |
|
42900
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
358 | iface->leave_conversation_async = |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
359 | purple_ircv3_protocol_conversation_leave_conversation_async; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
360 | iface->leave_conversation_finish = |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
361 | purple_ircv3_protocol_conversation_leave_conversation_finish; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
362 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
363 | iface->send_typing = |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
364 | purple_ircv3_protocol_conversation_send_typing; |
|
43105
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
365 | iface->refresh = |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
366 | purple_ircv3_protocol_conversation_refresh; |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
367 | } |