pidgin/pidginconversation.c

Tue, 22 Jul 2025 16:06:33 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 22 Jul 2025 16:06:33 -0500
changeset 43291
a14a8ae209a9
parent 43251
8bd7eee2f178
child 43297
b008934818f5
permissions
-rw-r--r--

Move the input box to a GtkSourceView

We already depend on GtkSourceView for spell checking and this will allow us
to implement completions for nicks and commands and other stuff we haven't
thought of yet.

I'm not super happy about tracking the adwait style manager, but that seems to be the only way to make sure the style matches the rest of the application.

Testing Done:
Compiled and sent some messages.

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

42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Pidgin - Internet Messenger
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * Pidgin is the legal property of its developers, whose names are too numerous
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * to list here. Please refer to the COPYRIGHT file distributed with this
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * source distribution.
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * (at your option) any later version.
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * GNU General Public License for more details.
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 * along with this program; if not, see <https://www.gnu.org/licenses/>.
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 */
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #include <glib/gi18n-lib.h>
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
25 #include <libspelling.h>
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
26
43291
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
27 #include <gtksourceview/gtksource.h>
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
28
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <purple.h>
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
31 #include "pidginautoadjustment.h"
42527
1954265c38f0 Implement the member list in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42519
diff changeset
32 #include "pidgincontactinfomenu.h"
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
33 #include "pidginconversation.h"
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
34 #include "pidgininfopane.h"
43093
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
35 #include "pidginmessage.h"
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
36 #include "pidginnotifiable.h"
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #define PIDGIN_CONVERSATION_DATA ("pidgin-conversation")
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 enum {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 PROP_0,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 PROP_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 N_PROPERTIES,
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
44 /* Overrides */
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
45 PROP_NEEDS_ATTENTION = N_PROPERTIES,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
46 PROP_NOTIFICATION_COUNT,
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 };
42584
687260353985 Make signal and property enums and initializers consistent
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42575
diff changeset
48 static GParamSpec *properties[N_PROPERTIES] = {NULL, };
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 struct _PidginConversation {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 GtkBox parent;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 PurpleConversation *conversation;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
55 GSettings *privacy_settings;
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
56
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 GtkWidget *info_pane;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 GtkWidget *history;
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
59 GtkAdjustment *history_adjustment;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
60
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
61 GtkWidget *member_list_search_entry;
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
62 GtkCustomFilter *member_list_filter;
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
63 GtkCustomSorter *member_list_sorter;
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
64
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
65 GtkWidget *input;
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
66 GtkSourceBuffer *input_buffer;
43099
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
67
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
68 GtkWidget *typing_label;
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
69 GtkWidget *status_label;
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
70
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
71 /* This is a temporary work around to get new message notifications working
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
72 * until we implement Purple.History properly.
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
73 * -- gk 2025-03-11
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
74 */
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
75 guint notification_count;
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 };
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
78 static void
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
79 pidgin_conversation_messages_changed_cb(GListModel *model, guint position,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
80 guint removed, guint added,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
81 gpointer data);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 * Helpers
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 *****************************************************************************/
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 static void
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
87 pidgin_conversation_set_notification_count(PidginConversation *conversation,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
88 guint notification_count)
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
89 {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
90 if(conversation->notification_count != notification_count) {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
91 GObject *obj = G_OBJECT(conversation);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
92
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
93 conversation->notification_count = notification_count;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
94
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
95 g_object_freeze_notify(obj);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
96 g_object_notify(obj, "needs-attention");
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
97 g_object_notify(obj, "notification-count");
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
98 g_object_thaw_notify(obj);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
99 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
100 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
101
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
102 static void
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 pidgin_conversation_set_conversation(PidginConversation *conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 PurpleConversation *purple_conversation)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 {
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
106 /* Disconnect our old signal. */
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
107 if(PURPLE_IS_CONVERSATION(conversation->conversation)) {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
108 GListModel *model = NULL;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
109
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
110 model = purple_conversation_get_messages(conversation->conversation);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
111 g_signal_handlers_disconnect_by_func(model,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
112 G_CALLBACK(pidgin_conversation_messages_changed_cb),
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
113 conversation);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
114 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
115
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 if(g_set_object(&conversation->conversation, purple_conversation)) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 if(PURPLE_IS_CONVERSATION(purple_conversation)) {
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
118 GListModel *model = NULL;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
119
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 g_object_set_data(G_OBJECT(purple_conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 PIDGIN_CONVERSATION_DATA, conversation);
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
122
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
123 model = purple_conversation_get_messages(conversation->conversation);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
124
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
125 g_signal_connect_object(model, "items-changed",
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
126 G_CALLBACK(pidgin_conversation_messages_changed_cb),
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
127 conversation, G_CONNECT_DEFAULT);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 g_object_notify_by_pspec(G_OBJECT(conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 properties[PROP_CONVERSATION]);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134
42784
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
135 /* This is used to call g_markup_escape_text for the topic before displaying it
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
136 * in its normal label and the tool tip for that label.
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
137 */
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
138 static char *
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
139 pidgin_conversation_escape_topic(G_GNUC_UNUSED GObject *self,
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
140 const char *topic,
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
141 G_GNUC_UNUSED gpointer data)
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
142 {
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
143 if(topic == NULL) {
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
144 return g_strdup("");
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
145 }
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
146
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
147 return g_markup_escape_text(topic, -1);
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
148 }
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
149
43129
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
150 static char *
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
151 pidgin_conversation_conversation_members_items_changed(G_GNUC_UNUSED PidginConversation *self,
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
152 guint n_members)
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
153 {
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
154 /* TRANSLATORS: This is a label for how many participants are in a
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
155 * conversation.
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
156 */
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
157 const char *format = g_dngettext(GETTEXT_PACKAGE, "%u Member",
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
158 "%u Members", n_members);
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
159
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
160 return g_strdup_printf(format, n_members);
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
161 }
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
162
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
163 /**
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
164 * pidgin_conversation_send_message:
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
165 * @conversation: The instance.
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
166 *
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
167 * Creates a [class@Purple.Message] from the input widgets of @conversation and
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
168 * sends it.
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
169 *
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
170 * Since: 3.0
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
171 */
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
172 static void
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
173 pidgin_conversation_send_message(PidginConversation *conversation) {
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
174 PurpleAccount *account = NULL;
42838
010bd75895d9 Use purple_message_new instead of purple_message_new_outgoing in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42826
diff changeset
175 PurpleContactInfo *info = NULL;
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
176 PurpleMessage *message = NULL;
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
177 GtkTextBuffer *buffer = NULL;
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
178 GtkTextIter start;
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
179 GtkTextIter end;
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
180 char *contents = NULL;
43058
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
181 gboolean command_executed = FALSE;
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
182
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
183 account = purple_conversation_get_account(conversation->conversation);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
184
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
185 /* Get the contents from the buffer. */
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
186 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(conversation->input));
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
187 gtk_text_buffer_get_start_iter(buffer, &start);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
188 gtk_text_buffer_get_end_iter(buffer, &end);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
189
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
190 contents = gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
191
43058
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
192 if(contents != NULL && contents[0] == '/') {
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
193 PurpleCommandManager *manager = NULL;
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
194
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
195 manager = purple_command_manager_get_default();
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
196 command_executed = purple_command_manager_find_and_execute(manager,
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
197 conversation->conversation,
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
198 contents + 1);
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
199 }
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
200
43058
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
201 if(!command_executed) {
43100
e6df74d36862 Change Purple.Message:author to Purple.ConversationMember
Gary Kramlich <grim@reaperworld.com>
parents: 43099
diff changeset
202 PurpleConversationMember *author = NULL;
e6df74d36862 Change Purple.Message:author to Purple.ConversationMember
Gary Kramlich <grim@reaperworld.com>
parents: 43099
diff changeset
203
43058
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
204 /* Create the message. */
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
205 info = purple_account_get_contact_info(account);
43100
e6df74d36862 Change Purple.Message:author to Purple.ConversationMember
Gary Kramlich <grim@reaperworld.com>
parents: 43099
diff changeset
206 author = purple_conversation_find_or_add_member(conversation->conversation,
e6df74d36862 Change Purple.Message:author to Purple.ConversationMember
Gary Kramlich <grim@reaperworld.com>
parents: 43099
diff changeset
207 info, FALSE, NULL);
e6df74d36862 Change Purple.Message:author to Purple.ConversationMember
Gary Kramlich <grim@reaperworld.com>
parents: 43099
diff changeset
208 message = purple_message_new(author, contents);
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
209
43058
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
210 /* Send the message and clean up. We don't worry about the callback as we
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
211 * don't have anything to do in it right now.
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
212 */
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
213 purple_conversation_send_message_async(conversation->conversation, message,
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
214 NULL, NULL, NULL);
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
215
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
216 g_clear_object(&message);
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
217 }
7b3b26faf6ed Add very basic command support to Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42905
diff changeset
218
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
219 g_clear_pointer(&contents, g_free);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
220
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
221 gtk_text_buffer_set_text(buffer, "", -1);
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
222 }
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
223
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
224 static gboolean
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
225 pidgin_conversation_get_needs_attention(PidginConversation *conversation)
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
226 {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
227 return conversation->notification_count > 0;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
228 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
229
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
230 static guint
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
231 pidgin_conversation_get_notification_count(PidginConversation *conversation) {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
232 return conversation->notification_count;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
233 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
234
43291
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
235 static void
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
236 pidgin_conversation_set_dark(PidginConversation *conversation, gboolean dark) {
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
237 GtkSourceStyleScheme *scheme = NULL;
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
238 GtkSourceStyleSchemeManager *manager = NULL;
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
239 const char *id = "Adwaita";
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
240
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
241 if(dark) {
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
242 id = "Adwaita-dark";
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
243 }
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
244
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
245 manager = gtk_source_style_scheme_manager_get_default();
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
246 scheme = gtk_source_style_scheme_manager_get_scheme(manager, id);
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
247
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
248 gtk_source_buffer_set_style_scheme(conversation->input_buffer, scheme);
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
249 }
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
250
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
251 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
252 * Callbacks
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
253 *****************************************************************************/
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
254 static void
43193
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
255 pidgin_conversation_messages_changed_cb(GListModel *model,
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
256 guint position,
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
257 G_GNUC_UNUSED guint removed,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
258 guint added,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
259 gpointer data)
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
260 {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
261 PidginConversation *conversation = data;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
262 guint current = conversation->notification_count;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
263
43193
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
264 for(guint i = position; i < position + added; i++) {
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
265 PurpleMessage *message = NULL;
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
266
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
267 message = g_list_model_get_item(model, i);
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
268 if(!purple_message_get_event(message)) {
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
269 current += 1;
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
270 }
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
271 g_clear_object(&message);
02f50223f45a Make the message notifications ignore events
Gary Kramlich <grim@reaperworld.com>
parents: 43192
diff changeset
272 }
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
273
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
274 pidgin_conversation_set_notification_count(conversation, current);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
275 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
276
43099
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
277 static char *
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
278 pidgin_conversation_get_status_label(G_GNUC_UNUSED PidginConversation *conversation,
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
279 GError *error, gboolean online)
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
280 {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
281 const char *message = NULL;
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
282
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
283 if(error != NULL) {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
284 message = error->message;
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
285 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
286
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
287 if(purple_strempty(message) && !online) {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
288 message = _("Conversation offline");
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
289 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
290
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
291 if(purple_strempty(message)) {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
292 message = "";
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
293 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
294
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
295 return g_strdup(message);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
296 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
297
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
298 static GtkWidget *
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
299 pidgin_conversation_get_status_page(PidginConversation *conversation,
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
300 GError *error, gboolean online)
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
301 {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
302 if(error != NULL || !online) {
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
303 return g_object_ref(conversation->status_label);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
304 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
305
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
306 return g_object_ref(conversation->typing_label);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
307 }
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
308
42885
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
309 static void
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
310 pidgin_conversation_input_insert_text_cb(G_GNUC_UNUSED GtkTextBuffer *buffer,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
311 G_GNUC_UNUSED const GtkTextIter *iter,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
312 G_GNUC_UNUSED char *text,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
313 G_GNUC_UNUSED int length,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
314 gpointer data)
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
315 {
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
316 PidginConversation *conversation = data;
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
317
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
318 if(g_settings_get_boolean(conversation->privacy_settings,
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
319 "send-typing-notifications"))
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
320 {
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
321 purple_conversation_set_typing_state(conversation->conversation,
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
322 PURPLE_TYPING_STATE_TYPING);
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
323 }
42885
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
324 }
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
325
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
326 static void
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
327 pidgin_conversation_input_delete_range_cb(GtkTextBuffer *buffer,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
328 G_GNUC_UNUSED const GtkTextIter *start,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
329 G_GNUC_UNUSED const GtkTextIter *end,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
330 gpointer data)
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
331 {
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
332 PidginConversation *conversation = data;
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
333
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
334 if(gtk_text_buffer_get_char_count(buffer) == 0) {
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
335 if(g_settings_get_boolean(conversation->privacy_settings,
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
336 "send-typing-notifications"))
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
337 {
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
338 purple_conversation_set_typing_state(conversation->conversation,
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
339 PURPLE_TYPING_STATE_NONE);
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
340 }
42885
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
341 }
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
342 }
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
343
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
344 static gboolean
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
345 pidgin_conversation_input_key_pressed_cb(G_GNUC_UNUSED GtkEventControllerKey *self,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
346 guint keyval,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
347 G_GNUC_UNUSED guint keycode,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
348 GdkModifierType state,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
349 gpointer data)
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
350 {
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
351 PidginConversation *conversation = data;
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
352 gboolean handled = TRUE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
353
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
354 if(keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter) {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
355 if(state == GDK_SHIFT_MASK || state == GDK_CONTROL_MASK) {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
356 return FALSE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
357 }
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
358
42812
4d48abf72b94 Update Pidgin.Conversation to use Purple.Conversation.send_message_async
Gary Kramlich <grim@reaperworld.com>
parents: 42801
diff changeset
359 pidgin_conversation_send_message(conversation);
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
360 } else if(keyval == GDK_KEY_Page_Up) {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
361 pidgin_auto_adjustment_decrement(PIDGIN_AUTO_ADJUSTMENT(conversation->history_adjustment));
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
362 } else if(keyval == GDK_KEY_Page_Down) {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
363 pidgin_auto_adjustment_increment(PIDGIN_AUTO_ADJUSTMENT(conversation->history_adjustment));
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
364 } else {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
365 handled = FALSE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
366 }
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
367
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
368 return handled;
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
369 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
370
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
371 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
372 pidgin_conversation_detach(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
373 if(PURPLE_IS_CONVERSATION(conversation->conversation)) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
374 gpointer us = NULL;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
375
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
376 us = g_object_get_data(G_OBJECT(conversation->conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
377 PIDGIN_CONVERSATION_DATA);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
378
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
379 if(conversation == us) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
380 g_object_set_data(G_OBJECT(conversation->conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
381 PIDGIN_CONVERSATION_DATA, NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
382 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
383 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
384 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
385
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
386 static void
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
387 pidgin_conversation_members_search_changed_cb(GtkSearchEntry *self,
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
388 gpointer data)
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
389 {
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
390 PidginConversation *conversation = data;
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
391
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
392 gtk_filter_changed(GTK_FILTER(conversation->member_list_filter),
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
393 GTK_FILTER_CHANGE_DIFFERENT);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
394
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
395 /* Make sure the search widget has focus, this allows the user to clear a
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
396 * search that has filtered out every item in the list via their keyboard.
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
397 */
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
398 if(!gtk_widget_has_focus(GTK_WIDGET(self))) {
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
399 gtk_widget_grab_focus(GTK_WIDGET(self));
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
400 }
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
401 }
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
402
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
403 static int
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
404 pidgin_conversation_member_list_sort(gconstpointer a, gconstpointer b,
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
405 G_GNUC_UNUSED gpointer data)
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
406 {
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
407 PurpleConversationMember *member_a = NULL;
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
408 PurpleConversationMember *member_b = NULL;
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
409
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
410 member_a = PURPLE_CONVERSATION_MEMBER((gpointer)a);
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
411 member_b = PURPLE_CONVERSATION_MEMBER((gpointer)b);
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
412
43201
1889c68bc5a0 Some minor clean up in Pidgin.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 43193
diff changeset
413 return purple_conversation_member_compare(member_a, member_b);
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
414 }
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
415
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
416 static gboolean
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
417 pidgin_conversation_member_list_filter(GObject *item, gpointer data) {
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
418 PidginConversation *conversation = data;
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
419 PurpleConversationMember *member = PURPLE_CONVERSATION_MEMBER(item);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
420 const char *needle = NULL;
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
421
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
422 needle = gtk_editable_get_text(GTK_EDITABLE(conversation->member_list_search_entry));
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
423
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
424 return purple_conversation_member_matches(member, needle);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
425 }
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
426
43093
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
427 static void
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
428 pidgin_conversation_message_setup(G_GNUC_UNUSED GtkSignalListItemFactory *self,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
429 GObject *object,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
430 G_GNUC_UNUSED gpointer data)
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
431 {
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
432 gtk_list_item_set_child(GTK_LIST_ITEM(object), pidgin_message_new(NULL));
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
433 }
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
434
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
435 static void
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
436 pidgin_conversation_message_bind(G_GNUC_UNUSED GtkSignalListItemFactory *self,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
437 GObject *object,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
438 G_GNUC_UNUSED gpointer data)
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
439 {
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
440 PurpleMessage *purple_message = NULL;
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
441 GtkListItem *item = GTK_LIST_ITEM(object);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
442 GtkWidget *pidgin_message = NULL;
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
443
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
444 purple_message = gtk_list_item_get_item(item);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
445 pidgin_message = gtk_list_item_get_child(item);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
446
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
447 pidgin_message_set_message(PIDGIN_MESSAGE(pidgin_message), purple_message);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
448 }
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
449
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
450 static void
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
451 pidgin_conversation_message_unbind(G_GNUC_UNUSED GtkSignalListItemFactory *self,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
452 GObject *object,
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
453 G_GNUC_UNUSED gpointer data)
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
454 {
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
455 GtkListItem *item = GTK_LIST_ITEM(object);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
456 GtkWidget *message = NULL;
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
457
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
458 message = gtk_list_item_get_child(item);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
459
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
460 pidgin_message_set_message(PIDGIN_MESSAGE(message), NULL);
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
461 }
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
462
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
463 static void
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
464 pidgin_conversation_map_cb(GtkWidget *self, G_GNUC_UNUSED gpointer data) {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
465 pidgin_conversation_set_notification_count(PIDGIN_CONVERSATION(self), 0);
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
466 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
467
43291
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
468 static void
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
469 pidgin_conversation_dark_cb(GObject *self, G_GNUC_UNUSED GParamSpec *pspec,
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
470 gpointer data)
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
471 {
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
472 PidginConversation *conversation = data;
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
473 AdwStyleManager *style_manager = ADW_STYLE_MANAGER(self);
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
474
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
475 pidgin_conversation_set_dark(conversation,
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
476 adw_style_manager_get_dark(style_manager));
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
477 }
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
478
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
479 /******************************************************************************
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
480 * PidginNotifiable Implementation
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
481 *****************************************************************************/
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
482 static void
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
483 pidgin_conversation_notifiable_init(G_GNUC_UNUSED PidginNotifiableInterface *iface)
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
484 {
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
485 }
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
486
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
487 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
488 * GObject Implementation
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
489 *****************************************************************************/
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
490 G_DEFINE_FINAL_TYPE_WITH_CODE(PidginConversation,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
491 pidgin_conversation,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
492 GTK_TYPE_BOX,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
493 G_IMPLEMENT_INTERFACE(PIDGIN_TYPE_NOTIFIABLE,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
494 pidgin_conversation_notifiable_init))
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
495
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
496 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
497 pidgin_conversation_dispose(GObject *obj) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
498 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
499
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
500 pidgin_conversation_detach(conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
501
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
502 g_clear_object(&conversation->conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
503
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
504 G_OBJECT_CLASS(pidgin_conversation_parent_class)->dispose(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
505 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
506
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
507 static void
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
508 pidgin_conversation_finalize(GObject *obj) {
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
509 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
510
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
511 g_clear_object(&conversation->privacy_settings);
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
512
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
513 G_OBJECT_CLASS(pidgin_conversation_parent_class)->finalize(obj);
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
514 }
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
515
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
516 static void
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
517 pidgin_conversation_get_property(GObject *obj, guint param_id, GValue *value,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
518 GParamSpec *pspec)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
519 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
520 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
521
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
522 switch(param_id) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
523 case PROP_CONVERSATION:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
524 g_value_set_object(value,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
525 pidgin_conversation_get_conversation(conversation));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
526 break;
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
527 case PROP_NEEDS_ATTENTION:
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
528 g_value_set_boolean(value,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
529 pidgin_conversation_get_needs_attention(conversation));
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
530 break;
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
531 case PROP_NOTIFICATION_COUNT:
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
532 g_value_set_uint(value,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
533 pidgin_conversation_get_notification_count(conversation));
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
534 break;
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
535 default:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
536 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
537 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
538 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
539 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
540
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
541 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
542 pidgin_conversation_set_property(GObject *obj, guint param_id,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
543 const GValue *value, GParamSpec *pspec)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
544 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
545 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
546
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
547 switch(param_id) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
548 case PROP_CONVERSATION:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
549 pidgin_conversation_set_conversation(conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
550 g_value_get_object(value));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
551 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
552 default:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
553 G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
554 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
555 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
556 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
557
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
558 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
559 pidgin_conversation_init(PidginConversation *conversation) {
43291
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
560 AdwStyleManager *style_manager = NULL;
43201
1889c68bc5a0 Some minor clean up in Pidgin.Conversation
Gary Kramlich <grim@reaperworld.com>
parents: 43193
diff changeset
561 GMenuModel *menu = NULL;
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
562 SpellingChecker *checker = NULL;
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
563 SpellingTextBufferAdapter *adapter = NULL;
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
564
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
565 gtk_widget_init_template(GTK_WIDGET(conversation));
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
566
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
567 conversation->privacy_settings =
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
568 g_settings_new_with_backend("im.pidgin.Pidgin3.Privacy",
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
569 purple_core_get_settings_backend());
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
570
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
571 gtk_custom_sorter_set_sort_func(conversation->member_list_sorter,
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
572 pidgin_conversation_member_list_sort,
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
573 NULL, NULL);
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
574
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
575 gtk_custom_filter_set_filter_func(conversation->member_list_filter,
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
576 (GtkCustomFilterFunc)pidgin_conversation_member_list_filter,
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
577 conversation, NULL);
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
578
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
579 /* Create the spell checking adapter. */
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
580 checker = spelling_checker_get_default();
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
581 adapter = spelling_text_buffer_adapter_new(conversation->input_buffer,
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
582 checker);
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
583
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
584 /* Add the spell checking menu items and actions. */
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
585 menu = spelling_text_buffer_adapter_get_menu_model(adapter);
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
586 gtk_text_view_set_extra_menu(GTK_TEXT_VIEW(conversation->input), menu);
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
587 gtk_widget_insert_action_group(conversation->input, "spelling",
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
588 G_ACTION_GROUP(adapter));
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
589 spelling_text_buffer_adapter_set_enabled(adapter, TRUE);
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
590
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
591 g_clear_object(&adapter);
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
592
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
593 /* Connect to our map signal to reset the notification-count property. */
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
594 g_signal_connect(conversation, "map",
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
595 G_CALLBACK(pidgin_conversation_map_cb), NULL);
43291
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
596
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
597 style_manager = adw_style_manager_get_default();
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
598 g_signal_connect_object(style_manager, "notify::dark",
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
599 G_CALLBACK(pidgin_conversation_dark_cb),
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
600 conversation, G_CONNECT_DEFAULT);
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
601 pidgin_conversation_set_dark(conversation,
a14a8ae209a9 Move the input box to a GtkSourceView
Gary Kramlich <grim@reaperworld.com>
parents: 43251
diff changeset
602 adw_style_manager_get_dark(style_manager));
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
603 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
604
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
605 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
606 pidgin_conversation_class_init(PidginConversationClass *klass) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
607 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
608 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
609
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
610 obj_class->dispose = pidgin_conversation_dispose;
43251
8bd7eee2f178 Create a Privacy preference page with the send typing notification preference
Gary Kramlich <grim@reaperworld.com>
parents: 43201
diff changeset
611 obj_class->finalize = pidgin_conversation_finalize;
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
612 obj_class->get_property = pidgin_conversation_get_property;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
613 obj_class->set_property = pidgin_conversation_set_property;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
614
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
615 /**
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
616 * PidginConversation:conversation:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
617 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
618 * The [class@Purple.Conversation] that this conversation is displaying.
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
619 *
42620
72178a341eb8 Remove minor versions from Since tags in Pidgin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42584
diff changeset
620 * Since: 3.0
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
621 */
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
622 properties[PROP_CONVERSATION] = g_param_spec_object(
43072
a59a119b74f5 Remove nick and blurb from Pidgin properties
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 43058
diff changeset
623 "conversation", NULL, NULL,
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
624 PURPLE_TYPE_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
625 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
626
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
627 g_object_class_install_properties(obj_class, N_PROPERTIES, properties);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
628
43192
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
629 g_object_class_override_property(obj_class, PROP_NEEDS_ATTENTION,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
630 "needs-attention");
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
631 g_object_class_override_property(obj_class, PROP_NOTIFICATION_COUNT,
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
632 "notification-count");
e690274aee75 Implement message notifications is a hacky way
Gary Kramlich <grim@reaperworld.com>
parents: 43186
diff changeset
633
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
634 /* Template stuff. */
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
635 gtk_widget_class_set_template_from_resource(
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
636 widget_class,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
637 "/im/pidgin/Pidgin3/Conversations/conversation.ui"
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
638 );
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
639
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
640 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
641 info_pane);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
642 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
643 history);
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
644 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
645 history_adjustment);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
646 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
647 member_list_search_entry);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
648 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
649 member_list_filter);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
650 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
651 member_list_sorter);
42783
e61721a750e9 Add support for sorting the memberlist in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 42620
diff changeset
652 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
653 input);
43099
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
654 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
43186
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
655 input_buffer);
f869ebb47d88 Add basic support for libspelling
Gary Kramlich <grim@reaperworld.com>
parents: 43173
diff changeset
656 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
43099
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
657 typing_label);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
658 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
659 status_label);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
660
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
661 gtk_widget_class_bind_template_callback(widget_class,
42784
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
662 pidgin_conversation_escape_topic);
909476a9e569 Escape the topic and its tooltip using g_markup_escape_text
Gary Kramlich <grim@reaperworld.com>
parents: 42783
diff changeset
663 gtk_widget_class_bind_template_callback(widget_class,
43173
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
664 pidgin_conversation_members_search_changed_cb);
399e2538f319 Implement searching the conversation members
Gary Kramlich <grim@reaperworld.com>
parents: 43163
diff changeset
665 gtk_widget_class_bind_template_callback(widget_class,
43129
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
666 pidgin_conversation_conversation_members_items_changed);
c72c9ce63177 Add a count of the members above the member list in conversations
Gary Kramlich <grim@reaperworld.com>
parents: 43100
diff changeset
667 gtk_widget_class_bind_template_callback(widget_class,
43099
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
668 pidgin_conversation_get_status_label);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
669 gtk_widget_class_bind_template_callback(widget_class,
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
670 pidgin_conversation_get_status_page);
60174e318ecc Add a status label to conversations to show online and error status
Gary Kramlich <grim@reaperworld.com>
parents: 43094
diff changeset
671 gtk_widget_class_bind_template_callback(widget_class,
42885
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
672 pidgin_conversation_input_insert_text_cb);
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
673 gtk_widget_class_bind_template_callback(widget_class,
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
674 pidgin_conversation_input_delete_range_cb);
9b0cae94f406 Set Purple.Conversation:typing when appropriate in Pidgin
Gary Kramlich <grim@reaperworld.com>
parents: 42838
diff changeset
675 gtk_widget_class_bind_template_callback(widget_class,
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
676 pidgin_conversation_input_key_pressed_cb);
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
677 gtk_widget_class_bind_template_callback(widget_class,
43093
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
678 pidgin_conversation_message_setup);
42380
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
679 gtk_widget_class_bind_template_callback(widget_class,
43093
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
680 pidgin_conversation_message_bind);
42531
82fffff36df6 If a message is an action format it with italics
Gary Kramlich <grim@reaperworld.com>
parents: 42527
diff changeset
681 gtk_widget_class_bind_template_callback(widget_class,
43093
27f816a512af Add a PidginMessage widget
Gary Kramlich <grim@reaperworld.com>
parents: 43072
diff changeset
682 pidgin_conversation_message_unbind);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
683 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
684
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
685 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
686 * API
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
687 *****************************************************************************/
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
688 GtkWidget *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
689 pidgin_conversation_new(PurpleConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
690 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
691
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
692 return g_object_new(
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
693 PIDGIN_TYPE_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
694 "conversation", conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
695 NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
696 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
697
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
698 GtkWidget *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
699 pidgin_conversation_from_purple_conversation(PurpleConversation *conversation)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
700 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
701 g_return_val_if_fail(PURPLE_IS_CONVERSATION(conversation), NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
702
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
703 return g_object_get_data(G_OBJECT(conversation), PIDGIN_CONVERSATION_DATA);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
704 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
705
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
706 PurpleConversation *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
707 pidgin_conversation_get_conversation(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
708 g_return_val_if_fail(PIDGIN_IS_CONVERSATION(conversation), NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
709
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
710 return conversation->conversation;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
711 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
712
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
713 void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
714 pidgin_conversation_close(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
715 g_return_if_fail(PIDGIN_IS_CONVERSATION(conversation));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
716
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
717 pidgin_conversation_detach(conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
718 }

mercurial