pidgin/pidginconversation.c

Thu, 16 Nov 2023 23:44:39 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 16 Nov 2023 23:44:39 -0600
changeset 42504
02c38caf387b
parent 42490
f864332b13ef
child 42519
9101c36a3f0c
permissions
-rw-r--r--

Depend on GPlugin 0.42.1

Testing Done:
Ran `ninja turtles` without issues and noted that the ircv3 introspection was successful.

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

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
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 #include <purple.h>
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
27 #include "pidginautoadjustment.h"
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
28 #include "pidgincolor.h"
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
29 #include "pidginconversation.h"
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
30 #include "pidgininfopane.h"
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #define PIDGIN_CONVERSATION_DATA ("pidgin-conversation")
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 enum {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 PROP_0,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 PROP_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 N_PROPERTIES,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 };
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 static GParamSpec *properties[N_PROPERTIES] = {NULL,};
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 struct _PidginConversation {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 GtkBox parent;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44 PurpleConversation *conversation;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 GtkWidget *info_pane;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 GtkWidget *history;
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
48 GtkAdjustment *history_adjustment;
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
49 GtkNoSelection *history_selection;
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
50
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
51 GtkWidget *input;
42301
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
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 G_DEFINE_TYPE(PidginConversation, pidgin_conversation, GTK_TYPE_BOX)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 * Helpers
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 *****************************************************************************/
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 pidgin_conversation_set_conversation(PidginConversation *conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 PurpleConversation *purple_conversation)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 if(g_set_object(&conversation->conversation, purple_conversation)) {
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
64 GListModel *model = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
65
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 if(PURPLE_IS_CONVERSATION(purple_conversation)) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 g_object_set_data(G_OBJECT(purple_conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 PIDGIN_CONVERSATION_DATA, conversation);
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
69 model = purple_conversation_get_messages(purple_conversation);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
72 gtk_no_selection_set_model(conversation->history_selection, model);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
73
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 pidgin_info_pane_set_conversation(PIDGIN_INFO_PANE(conversation->info_pane),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 purple_conversation);
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 g_object_notify_by_pspec(G_OBJECT(conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 properties[PROP_CONVERSATION]);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81
42350
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
82 /**
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
83 * pidgin_conversation_set_tooltip_for_timestamp: (skip)
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
84 * @tooltip: The tooltip to update.
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
85 * @timestamp: The timestamp to set.
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
86 *
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
87 * Updates @tooltip to display @timestamp. This is meant to be called from
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
88 * a GtkWidget::query-tooltip signal and its return value should be returned
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
89 * from that handler.
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
90 *
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
91 * Returns: %TRUE if a tooltip was set, otherwise %FALSE.
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
92 *
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
93 * Since: 3.0.0
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
94 */
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
95 static gboolean
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
96 pidgin_conversation_set_tooltip_for_timestamp(GtkTooltip *tooltip,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
97 GDateTime *timestamp)
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
98 {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
99 GDateTime *local = NULL;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
100 char *text = NULL;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
101
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
102 if(timestamp == NULL) {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
103 return FALSE;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
104 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
105
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
106 local = g_date_time_to_local(timestamp);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
107 text = g_date_time_format(local, "%c");
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
108 g_clear_pointer(&local, g_date_time_unref);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
109
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
110 gtk_tooltip_set_text(tooltip, text);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
111 g_clear_pointer(&text, g_free);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
112
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
113 return TRUE;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
114 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
115
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 * Callbacks
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 *****************************************************************************/
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
119 static gboolean
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
120 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
121 guint keyval,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
122 G_GNUC_UNUSED guint keycode,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
123 GdkModifierType state,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
124 gpointer data)
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
125 {
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 PidginConversation *conversation = data;
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
127 gboolean handled = TRUE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
128
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
129 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
130 GtkTextBuffer *buffer = NULL;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
131 GtkTextIter start;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
132 GtkTextIter end;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
133 char *contents = NULL;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
134
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
135 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
136 return FALSE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
137 }
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
139 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(conversation->input));
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
140 gtk_text_buffer_get_start_iter(buffer, &start);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
141 gtk_text_buffer_get_end_iter(buffer, &end);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
142
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
143 contents = gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
144
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
145 purple_conversation_send(conversation->conversation, contents);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
146
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
147 g_clear_pointer(&contents, g_free);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
149 gtk_text_buffer_set_text(buffer, "", -1);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
150 } 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
151 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
152 } 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
153 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
154 } else {
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
155 handled = FALSE;
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
156 }
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
157
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
158 return handled;
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
159 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
160
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
161 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
162 pidgin_conversation_detach(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
163 if(PURPLE_IS_CONVERSATION(conversation->conversation)) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
164 gpointer us = NULL;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
165
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
166 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
167 PIDGIN_CONVERSATION_DATA);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
168
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
169 if(conversation == us) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
170 g_object_set_data(G_OBJECT(conversation->conversation),
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
171 PIDGIN_CONVERSATION_DATA, NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
172 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
173 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
174 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
175
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
176 static PangoAttrList *
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
177 pidgin_conversation_get_author_attributes(G_GNUC_UNUSED GObject *self,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
178 PurpleMessage *message,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
179 G_GNUC_UNUSED gpointer data)
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
180 {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
181 const char *author = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
182 const char *custom_color = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
183 GdkRGBA rgba;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
184 PangoAttrList *attrs = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
185 gboolean color_valid = FALSE;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
186
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
187 if(!PURPLE_IS_MESSAGE(message)) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
188 return NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
189 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
190
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
191 author = purple_message_get_author_alias(message);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
192 if(purple_strempty(author)) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
193 author = purple_message_get_author(message);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
194 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
195
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
196 custom_color = purple_message_get_author_name_color(message);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
197 if(!purple_strempty(custom_color)) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
198 color_valid = gdk_rgba_parse(&rgba, custom_color);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
199 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
200
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
201 if(!color_valid) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
202 pidgin_color_calculate_for_text(author, &rgba);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
203 color_valid = TRUE;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
204 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
205
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
206 attrs = pango_attr_list_new();
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
207
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
208 if(color_valid) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
209 PangoAttribute *attr = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
210
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
211 attr = pango_attr_foreground_new(0xFFFF * rgba.red,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
212 0xFFFF * rgba.green,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
213 0xFFFF * rgba.blue);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
214 pango_attr_list_insert(attrs, attr);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
215 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
216
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
217 return attrs;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
218 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
219
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
220 static char *
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
221 pidgin_converation_get_timestamp_string(G_GNUC_UNUSED GObject *self,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
222 PurpleMessage *message,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
223 G_GNUC_UNUSED gpointer data)
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
224 {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
225 GDateTime *timestamp = NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
226
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
227 if(!PURPLE_IS_MESSAGE(message)) {
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
228 return NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
229 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
230
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
231 timestamp = purple_message_get_timestamp(message);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
232 if(timestamp != NULL) {
42490
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
233 GDateTime *local = NULL;
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
234 char *ret = NULL;
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
235
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
236 local = g_date_time_to_local(timestamp);
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
237 ret = g_date_time_format(local, "%I:%M %p");
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
238 g_date_time_unref(local);
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
239
f864332b13ef Make sure the timestamp shown on messages is in the user's local time
Gary Kramlich <grim@reaperworld.com>
parents: 42447
diff changeset
240 return ret;
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
241 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
242
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
243 return NULL;
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
244 }
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
245
42350
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
246 static gboolean
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
247 pidgin_conversation_query_tooltip_timestamp_cb(G_GNUC_UNUSED GtkWidget *self,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
248 G_GNUC_UNUSED gint x,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
249 G_GNUC_UNUSED gint y,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
250 G_GNUC_UNUSED gboolean keyboard_mode,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
251 GtkTooltip *tooltip,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
252 gpointer data)
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
253 {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
254
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
255 PurpleMessage *message = gtk_list_item_get_item(data);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
256 GDateTime *timestamp = NULL;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
257
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
258 if(!PURPLE_IS_MESSAGE(message)) {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
259 return FALSE;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
260 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
261
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
262 timestamp = purple_message_get_timestamp(message);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
263
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
264 return pidgin_conversation_set_tooltip_for_timestamp(tooltip, timestamp);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
265 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
266
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
267 static gboolean
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
268 pidgin_conversation_query_tooltip_edited_cb(G_GNUC_UNUSED GtkWidget *self,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
269 G_GNUC_UNUSED gint x,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
270 G_GNUC_UNUSED gint y,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
271 G_GNUC_UNUSED gboolean keyboard_mode,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
272 GtkTooltip *tooltip,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
273 gpointer data)
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
274 {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
275 PurpleMessage *message = gtk_list_item_get_item(data);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
276 GDateTime *timestamp = NULL;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
277
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
278 if(!PURPLE_IS_MESSAGE(message)) {
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
279 return FALSE;
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
280 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
281
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
282 timestamp = purple_message_get_edited_at(message);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
283
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
284 return pidgin_conversation_set_tooltip_for_timestamp(tooltip, timestamp);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
285 }
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
286
42380
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
287 static char *
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
288 pidgin_conversation_process_message_contents_cb(G_GNUC_UNUSED GObject *self,
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
289 const char *contents,
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
290 G_GNUC_UNUSED gpointer data)
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
291 {
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
292 return g_markup_escape_text(contents, -1);
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
293 }
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
294
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
295 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
296 * GObject Implementation
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
297 *****************************************************************************/
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
298 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
299 pidgin_conversation_dispose(GObject *obj) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
300 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
302 pidgin_conversation_detach(conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
303
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
304 g_clear_object(&conversation->conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
305
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
306 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
307 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
308
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
309 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
310 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
311 GParamSpec *pspec)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
312 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
313 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
314
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
315 switch(param_id) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
316 case PROP_CONVERSATION:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
317 g_value_set_object(value,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
318 pidgin_conversation_get_conversation(conversation));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
319 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
320 default:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
321 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
322 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
323 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
324 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
325
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
326 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
327 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
328 const GValue *value, GParamSpec *pspec)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
329 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
330 PidginConversation *conversation = PIDGIN_CONVERSATION(obj);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
331
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
332 switch(param_id) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
333 case PROP_CONVERSATION:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
334 pidgin_conversation_set_conversation(conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
335 g_value_get_object(value));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
336 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
337 default:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
338 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
339 break;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
340 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
341 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
342
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
343 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
344 pidgin_conversation_init(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
345 gtk_widget_init_template(GTK_WIDGET(conversation));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
346 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
347
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
348 static void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
349 pidgin_conversation_class_init(PidginConversationClass *klass) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
350 GObjectClass *obj_class = G_OBJECT_CLASS(klass);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
351 GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
352
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
353 obj_class->dispose = pidgin_conversation_dispose;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
354 obj_class->get_property = pidgin_conversation_get_property;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
355 obj_class->set_property = pidgin_conversation_set_property;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
356
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
357 /**
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
358 * PidginConversation:conversation:
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
359 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
360 * 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
361 *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
362 * Since: 3.0.0
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
363 */
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
364 properties[PROP_CONVERSATION] = g_param_spec_object(
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
365 "conversation", "conversation",
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
366 "The purple conversation this widget is for.",
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
367 PURPLE_TYPE_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
368 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
369
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
370 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
371
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
372 /* Template stuff. */
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
373 gtk_widget_class_set_template_from_resource(
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
374 widget_class,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
375 "/im/pidgin/Pidgin3/Conversations/conversation.ui"
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
376 );
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
377
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
378 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
379 info_pane);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
380 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
381 history);
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
382 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
383 history_selection);
42447
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
384 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
385 history_adjustment);
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
386 gtk_widget_class_bind_template_child(widget_class, PidginConversation,
3f1004d7772a Replace TalkatuEditor in PidginConversation with a basic GtkTextView
Gary Kramlich <grim@reaperworld.com>
parents: 42380
diff changeset
387 input);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
388
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
389 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
390 pidgin_conversation_input_key_pressed_cb);
42346
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
391 gtk_widget_class_bind_template_callback(widget_class,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
392 pidgin_conversation_get_author_attributes);
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
393 gtk_widget_class_bind_template_callback(widget_class,
45d2756d2a14 Replace TalkatuHistory with our own implementation
Gary Kramlich <grim@reaperworld.com>
parents: 42301
diff changeset
394 pidgin_converation_get_timestamp_string);
42350
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
395 gtk_widget_class_bind_template_callback(widget_class,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
396 pidgin_conversation_query_tooltip_timestamp_cb);
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
397 gtk_widget_class_bind_template_callback(widget_class,
0d5319e4b836 Add tooltips to timestamps in PidginConversation
Gary Kramlich <grim@reaperworld.com>
parents: 42346
diff changeset
398 pidgin_conversation_query_tooltip_edited_cb);
42380
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
399 gtk_widget_class_bind_template_callback(widget_class,
165c0b7f3860 Escape message content in Pidgin before displaying it
Gary Kramlich <grim@reaperworld.com>
parents: 42350
diff changeset
400 pidgin_conversation_process_message_contents_cb);
42301
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
401 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
402
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
403 /******************************************************************************
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
404 * API
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
405 *****************************************************************************/
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
406 GtkWidget *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
407 pidgin_conversation_new(PurpleConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
408 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
409
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
410 return g_object_new(
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
411 PIDGIN_TYPE_CONVERSATION,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
412 "conversation", conversation,
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
413 NULL);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
414 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
415
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
416 GtkWidget *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
417 pidgin_conversation_from_purple_conversation(PurpleConversation *conversation)
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
418 {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
419 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
420
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
421 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
422 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
423
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
424 PurpleConversation *
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
425 pidgin_conversation_get_conversation(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
426 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
427
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
428 return conversation->conversation;
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
429 }
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
430
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
431 void
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
432 pidgin_conversation_close(PidginConversation *conversation) {
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
433 g_return_if_fail(PIDGIN_IS_CONVERSATION(conversation));
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
434
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
435 pidgin_conversation_detach(conversation);
d3930fe5505c The start of the new conversation window
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
436 }

mercurial