Thu, 24 Apr 2025 22:19:39 -0500
IRCv3: check if a member is in a conversation before adding them
Awhile ago we update the NAMREPLY handler to build a separate
Purple.ConversationMembers and then splice that onto the existing one to help
with sorting and other performance issues. However, we didn't check if the
users already existed in the existing list, so we would get duplicates. This
address that.
Also fixed a reference leak.
Testing Done:
Joined a channel and sent `/quote names #channel` multiple times and verified that the member list did not grow to include a bunch of duplicates.
Reviewed at https://reviews.imfreedom.org/r/3987/
|
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 | |
|
42769
c488d7af2923
Move the IRCv3 protocol plugin to our new Ibis library
Gary Kramlich <grim@reaperworld.com>
parents:
42653
diff
changeset
|
190 | ibis_client_write(client, message); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
191 | |
|
43200
163d7b5a8364
IRCv3: Normalize channel names when joining and looking for existing ones
Gary Kramlich <grim@reaperworld.com>
parents:
43183
diff
changeset
|
192 | 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
|
193 | |
|
43235
42e7b89033fe
Make Purple.ProtocolConversation.join_channel_finish return a conversation
Gary Kramlich <grim@reaperworld.com>
parents:
43200
diff
changeset
|
194 | g_task_return_pointer(task, conversation, g_object_unref); |
|
42450
bd1327c022d4
fix some memory leaks
Markus Fischer <ivanhoe@fiscari.de>
parents:
42378
diff
changeset
|
195 | g_clear_object(&task); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
196 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
197 | |
|
43235
42e7b89033fe
Make Purple.ProtocolConversation.join_channel_finish return a conversation
Gary Kramlich <grim@reaperworld.com>
parents:
43200
diff
changeset
|
198 | static PurpleConversation * |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
199 | 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
|
200 | GAsyncResult *result, |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
201 | GError **error) |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
202 | { |
|
43235
42e7b89033fe
Make Purple.ProtocolConversation.join_channel_finish return a conversation
Gary Kramlich <grim@reaperworld.com>
parents:
43200
diff
changeset
|
203 | return g_task_propagate_pointer(G_TASK(result), error); |
|
42378
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
204 | } |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
205 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
206 | static void |
|
42900
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
207 | purple_ircv3_protocol_conversation_leave_conversation_async(PurpleProtocolConversation *protocol, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
208 | PurpleConversation *conversation, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
209 | GCancellable *cancellable, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
210 | GAsyncReadyCallback callback, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
211 | gpointer data) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
212 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
213 | GTask *task = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
214 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
215 | if(purple_conversation_is_channel(conversation)) { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
216 | PurpleIRCv3Connection *v3_connection = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
217 | PurpleAccount *account = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
218 | PurpleConnection *connection = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
219 | IbisClient *client = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
220 | IbisMessage *message = NULL; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
221 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
222 | account = purple_conversation_get_account(conversation); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
223 | connection = purple_account_get_connection(account); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
224 | v3_connection = PURPLE_IRCV3_CONNECTION(connection); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
225 | client = purple_ircv3_connection_get_client(v3_connection); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
226 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
227 | message = ibis_message_new(IBIS_MSG_PART); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
228 | ibis_message_set_params(message, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
229 | purple_conversation_get_id(conversation), |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
230 | NULL); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
231 | ibis_client_write(client, message); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
232 | } |
|
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 | task = g_task_new(protocol, cancellable, callback, data); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
235 | g_task_set_source_tag(task, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
236 | purple_ircv3_protocol_conversation_leave_conversation_async); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
237 | g_task_return_boolean(task, TRUE); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
238 | g_clear_object(&task); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
239 | } |
|
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 | static gboolean |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
242 | 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
|
243 | GAsyncResult *result, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
244 | GError **error) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
245 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
246 | 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
|
247 | |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
248 | if(!g_async_result_is_tagged(result, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
249 | purple_ircv3_protocol_conversation_leave_conversation_async)) |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
250 | { |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
251 | g_set_error_literal(error, PURPLE_IRCV3_DOMAIN, 0, |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
252 | "result has unexpected tag"); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
253 | return FALSE; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
254 | } |
|
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 | return g_task_propagate_boolean(G_TASK(result), error); |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
257 | } |
|
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 | static void |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
260 | 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
|
261 | PurpleConversation *conversation, |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
262 | PurpleTypingState state) |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
263 | { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
264 | PurpleIRCv3Connection *connection; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
265 | PurpleAccount *account = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
266 | 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
|
267 | PurpleConversation *status_conversation = NULL; |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
268 | IbisClient *client = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
269 | IbisMessage *message = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
270 | IbisTags *tags = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
271 | const char *value = NULL; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
272 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
273 | if(state == PURPLE_TYPING_STATE_TYPING) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
274 | value = IBIS_TYPING_ACTIVE; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
275 | } else if(state == PURPLE_TYPING_STATE_PAUSED) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
276 | value = IBIS_TYPING_PAUSED; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
277 | } else if(state == PURPLE_TYPING_STATE_NONE) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
278 | value = IBIS_TYPING_DONE; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
279 | } |
|
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 | if(value == NULL) { |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
282 | return; |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
283 | } |
|
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 | account = purple_conversation_get_account(conversation); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
286 | purple_connection = purple_account_get_connection(account); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
287 | connection = PURPLE_IRCV3_CONNECTION(purple_connection); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
288 | |
|
43124
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
289 | 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
|
290 | if(conversation == status_conversation) { |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
291 | return; |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
292 | } |
|
711b58ead6df
IRCv3: Don't send typing messages in the status conversations
Gary Kramlich <grim@reaperworld.com>
parents:
43105
diff
changeset
|
293 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
294 | message = ibis_message_new(IBIS_MSG_TAGMSG); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
295 | 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
|
296 | NULL); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
297 | |
|
43022
567e86fd4234
IRCv3: Fix an ibis deprecation
Gary Kramlich <grim@reaperworld.com>
parents:
42933
diff
changeset
|
298 | tags = ibis_message_get_tags(message); |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
299 | ibis_tags_add(tags, IBIS_TAG_TYPING, value); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
300 | |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
301 | client = purple_ircv3_connection_get_client(connection); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
302 | ibis_client_write(client, message); |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
303 | } |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
304 | |
|
43105
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
305 | static void |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
306 | 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
|
307 | PurpleConversation *conversation) |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
308 | { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
309 | PurpleIRCv3Connection *connection; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
310 | PurpleAccount *account = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
311 | PurpleConnection *purple_connection = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
312 | IbisClient *client = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
313 | IbisMessage *message = NULL; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
314 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
315 | if(purple_conversation_get_online(conversation)) { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
316 | return; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
317 | } |
|
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 | if(!purple_conversation_is_channel(conversation)) { |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
320 | /* We need to mark DM's as online again. */ |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
321 | purple_conversation_set_online(conversation, TRUE); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
322 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
323 | return; |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
324 | } |
|
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 | account = purple_conversation_get_account(conversation); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
327 | purple_connection = purple_account_get_connection(account); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
328 | connection = PURPLE_IRCV3_CONNECTION(purple_connection); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
329 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
330 | message = ibis_message_new(IBIS_MSG_JOIN); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
331 | 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
|
332 | NULL); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
333 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
334 | client = purple_ircv3_connection_get_client(connection); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
335 | ibis_client_write(client, message); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
336 | |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
337 | /* 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
|
338 | * but right now we just assume it was successful. |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
339 | */ |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
340 | purple_conversation_set_online(conversation, TRUE); |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
341 | } |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
342 | |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
343 | void |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
344 | purple_ircv3_protocol_conversation_init(PurpleProtocolConversationInterface *iface) { |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
345 | iface->send_message_async = |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
346 | purple_ircv3_protocol_conversation_send_message_async; |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
347 | iface->send_message_finish = |
|
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
348 | 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
|
349 | |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
350 | iface->get_channel_join_details = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
351 | 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
|
352 | iface->join_channel_async = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
353 | 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
|
354 | iface->join_channel_finish = |
|
b64cb320215a
IRCv3: Implement the channel joining functions in PurpleProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
42320
diff
changeset
|
355 | purple_ircv3_protocol_conversation_join_channel_finish; |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
356 | |
|
42900
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
357 | iface->leave_conversation_async = |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
358 | purple_ircv3_protocol_conversation_leave_conversation_async; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
359 | iface->leave_conversation_finish = |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
360 | purple_ircv3_protocol_conversation_leave_conversation_finish; |
|
f7601128636b
IRCv3: Implement leaving conversations
Gary Kramlich <grim@reaperworld.com>
parents:
42889
diff
changeset
|
361 | |
|
42889
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
362 | iface->send_typing = |
|
9e329eab0f9d
IRCv3: Implement sending typing notifications
Gary Kramlich <grim@reaperworld.com>
parents:
42799
diff
changeset
|
363 | purple_ircv3_protocol_conversation_send_typing; |
|
43105
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
364 | iface->refresh = |
|
73562f3b9809
IRCv3: Implement Purple.ProtocolConversation.refresh
Gary Kramlich <grim@reaperworld.com>
parents:
43098
diff
changeset
|
365 | purple_ircv3_protocol_conversation_refresh; |
|
42320
21cab78fb7d2
IRCv3: Move from ProtocolIM to ProtocolConversation
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
366 | } |