annotate libpurple/conversation.c @ 32456:3caef255ad47

Convert jabber prpl to use accessor functions purple_connection_get_protocol_data() and purple_connection_set_protocol_data().
author andrew.victor@mxit.com
date Tue, 30 Aug 2011 19:11:26 +0000
parents e5e81ce9c564
children ac6353ffa129 968a51c4fa9d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2 * purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19606
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 #include "internal.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 #include "blist.h"
17221
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
24 #include "cmds.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 #include "conversation.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include "dbus-maybe.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "debug.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include "imgstore.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "prefs.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "prpl.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "request.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "signals.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34 #include "util.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35
25861
7f552614ec8a applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents: 23782
diff changeset
36 #define SEND_TYPED_TIMEOUT_SECONDS 5
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38 static GList *conversations = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 static GList *ims = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 static GList *chats = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
41 static PurpleConversationUiOps *default_ops = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
43 /**
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
44 * A hash table used for efficient lookups of conversations by name.
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
45 * struct _purple_hconv => PurpleConversation*
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
46 */
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
47 static GHashTable *conversation_cache = NULL;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
48
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
49 struct _purple_hconv {
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
50 PurpleConversationType type;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
51 char *name;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
52 const PurpleAccount *account;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
53 };
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
54
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
55 static guint _purple_conversations_hconv_hash(struct _purple_hconv *hc)
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
56 {
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
57 return g_str_hash(hc->name) ^ hc->type ^ g_direct_hash(hc->account);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
58 }
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
59
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
60 static guint _purple_conversations_hconv_equal(struct _purple_hconv *hc1, struct _purple_hconv *hc2)
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
61 {
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
62 return (hc1->type == hc2->type &&
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
63 hc1->account == hc2->account &&
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
64 g_str_equal(hc1->name, hc2->name));
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
65 }
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
66
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
67 static void _purple_conversations_hconv_free_key(struct _purple_hconv *hc)
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
68 {
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
69 g_free(hc->name);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
70 g_free(hc);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
71 }
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
72
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
73 static guint _purple_conversation_user_hash(gconstpointer data)
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
74 {
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
75 const gchar *name = data;
32174
94e1e3ed0bb0 conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <paul@darkrain42.org>
parents: 32173
diff changeset
76 gchar *collated;
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
77 guint hash;
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
78
32174
94e1e3ed0bb0 conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <paul@darkrain42.org>
parents: 32173
diff changeset
79 collated = g_utf8_collate_key(name, -1);
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
80 hash = g_str_hash(collated);
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
81 g_free(collated);
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
82 return hash;
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
83 }
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
84
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
85 static gboolean _purple_conversation_user_equal(gconstpointer a, gconstpointer b)
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
86 {
32174
94e1e3ed0bb0 conversation: Use the right comparison type (case-sensitive) for the hash table
Paul Aurich <paul@darkrain42.org>
parents: 32173
diff changeset
87 return !g_utf8_collate(a, b);
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
88 }
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
89
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
90 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
91 purple_conversations_set_ui_ops(PurpleConversationUiOps *ops)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
92 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 default_ops = ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
95
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
96 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
97 reset_typing_cb(gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
98 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
99 PurpleConversation *c = (PurpleConversation *)data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
100 PurpleConvIm *im;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
101
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
102 im = PURPLE_CONV_IM(c);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
103
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
104 purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
105 purple_conv_im_stop_typing_timeout(im);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
110 static gboolean
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 send_typed_cb(gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
113 PurpleConversation *conv = (PurpleConversation *)data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
114 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115 const char *name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 g_return_val_if_fail(conv != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
119 gc = purple_conversation_get_gc(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
120 name = purple_conversation_get_name(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
121
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122 if (gc != NULL && name != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
123 /* We set this to 1 so that PURPLE_TYPING will be sent
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
124 * if the Purple user types anything else.
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
126 purple_conv_im_set_type_again(PURPLE_CONV_IM(conv), 1);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
127
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
128 serv_send_typing(gc, name, PURPLE_TYPED);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
130 purple_debug(PURPLE_DEBUG_MISC, "conversation", "typed...\n");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
137 common_send(PurpleConversation *conv, const char *message, PurpleMessageFlags msgflags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
139 PurpleConversationType type;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
140 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
141 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142 char *displayed = NULL, *sent = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 int err = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144
23299
b2f91d7d3427 Don't use strlen() when we can just check the first character
Mark Doliner <mark@kingant.net>
parents: 23171
diff changeset
145 if (*message == '\0')
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
148 account = purple_conversation_get_account(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
149 gc = purple_conversation_get_gc(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 g_return_if_fail(gc != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
154 type = purple_conversation_get_type(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155
18025
7790021b1270 add a PURPLE_MESSAGE_NO_LINKIFY to prevent things from getting linkified
Nathan Walp <nwalp@pidgin.im>
parents: 18006
diff changeset
156 /* Always linkfy the text for display, unless we're
7790021b1270 add a PURPLE_MESSAGE_NO_LINKIFY to prevent things from getting linkified
Nathan Walp <nwalp@pidgin.im>
parents: 18006
diff changeset
157 * explicitly asked to do otheriwse*/
19511
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
158 if (!(msgflags & PURPLE_MESSAGE_INVISIBLE)) {
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
159 if(msgflags & PURPLE_MESSAGE_NO_LINKIFY)
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
160 displayed = g_strdup(message);
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
161 else
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
162 displayed = purple_markup_linkify(message);
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
163 }
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
164
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
165 if (displayed && (conv->features & PURPLE_CONNECTION_HTML) &&
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
166 !(msgflags & PURPLE_MESSAGE_RAW)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 sent = g_strdup(displayed);
19511
ea26d30449fd Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19509
diff changeset
168 } else
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 sent = g_strdup(message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
171 msgflags |= PURPLE_MESSAGE_SEND;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
172
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
173 if (type == PURPLE_CONV_TYPE_IM) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
174 PurpleConvIm *im = PURPLE_CONV_IM(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
175
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
176 purple_signal_emit(purple_conversations_get_handle(), "sending-im-msg",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 account,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
178 purple_conversation_get_name(conv), &sent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 if (sent != NULL && sent[0] != '\0') {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
182 err = serv_send_im(gc, purple_conversation_get_name(conv),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 sent, msgflags);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 if ((err > 0) && (displayed != NULL))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
186 purple_conv_im_write(im, NULL, displayed, msgflags, time(NULL));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
187
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
188 purple_signal_emit(purple_conversations_get_handle(), "sent-im-msg",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 account,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
190 purple_conversation_get_name(conv), sent);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
194 purple_signal_emit(purple_conversations_get_handle(), "sending-chat-msg",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 account, &sent,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
196 purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 if (sent != NULL && sent[0] != '\0') {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
199 err = serv_chat_send(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)), sent, msgflags);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
200
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
201 purple_signal_emit(purple_conversations_get_handle(), "sent-chat-msg",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 account, sent,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
203 purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
204 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
205 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 if (err < 0) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 const char *who;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 const char *msg;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
211 who = purple_conversation_get_name(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
213 if (err == -E2BIG) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
214 msg = _("Unable to send message: The message is too large.");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
216 if (!purple_conv_present_error(who, account, msg)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
218 purple_notify_error(gc, NULL, msg2, _("The message is too large."));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 g_free(msg2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 else if (err == -ENOTCONN) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
223 purple_debug(PURPLE_DEBUG_ERROR, "conversation",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224 "Not yet connected.\n");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
225 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 msg = _("Unable to send message.");
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
229 if (!purple_conv_present_error(who, account, msg)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 char *msg2 = g_strdup_printf(_("Unable to send message to %s."), who);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
231 purple_notify_error(gc, NULL, msg2, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 g_free(msg2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 g_free(displayed);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 g_free(sent);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
242 open_log(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
244 conv->logs = g_list_append(NULL, purple_log_new(conv->type == PURPLE_CONV_TYPE_CHAT ? PURPLE_LOG_CHAT :
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
245 PURPLE_LOG_IM, conv->name, conv->account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
246 conv, time(NULL), NULL));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
247 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
248
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
249 /* Functions that deal with PurpleConvMessage */
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
250
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
251 static void
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
252 add_message_to_history(PurpleConversation *conv, const char *who, const char *alias,
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
253 const char *message, PurpleMessageFlags flags, time_t when)
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
254 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
255 PurpleConvMessage *msg;
22317
6fc8f0c825e0 Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22262
diff changeset
256 PurpleConnection *gc;
6fc8f0c825e0 Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22262
diff changeset
257
6fc8f0c825e0 Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22262
diff changeset
258 gc = purple_account_get_connection(conv->account);
19424
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
259
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
260 if (flags & PURPLE_MESSAGE_SEND) {
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
261 const char *me = NULL;
22317
6fc8f0c825e0 Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22262
diff changeset
262 if (gc)
6fc8f0c825e0 Kill off some uses of account->gc.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22262
diff changeset
263 me = purple_connection_get_display_name(gc);
19424
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
264 if (!me)
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
265 me = conv->account->username;
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
266 who = me;
c17e41049b61 Do not duplicate the same message in the history, and store the correct
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19418
diff changeset
267 }
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
268
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
269 msg = g_new0(PurpleConvMessage, 1);
19418
b33c2b085e78 DBus-ify the message history in a conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19416
diff changeset
270 PURPLE_DBUS_REGISTER_POINTER(msg, PurpleConvMessage);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
271 msg->who = g_strdup(who);
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
272 msg->alias = g_strdup(alias);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
273 msg->flags = flags;
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
274 msg->what = g_strdup(message);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
275 msg->when = when;
20179
bd7244f3d491 Contactize the message history when re-attaching the pidgin ui.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20174
diff changeset
276 msg->conv = conv;
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
277
19705
7ea794e7cec3 Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
278 conv->message_history = g_list_prepend(conv->message_history, msg);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
279 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
280
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
281 static void
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
282 free_conv_message(PurpleConvMessage *msg)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
283 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
284 g_free(msg->who);
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
285 g_free(msg->alias);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
286 g_free(msg->what);
19418
b33c2b085e78 DBus-ify the message history in a conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19416
diff changeset
287 PURPLE_DBUS_UNREGISTER_POINTER(msg);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
288 g_free(msg);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
289 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
290
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
291 static void
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
292 message_history_free(GList *list)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
293 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
294 g_list_foreach(list, (GFunc)free_conv_message, NULL);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
295 g_list_free(list);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
296 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 * Conversation API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300 **************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
302 purple_conversation_chat_cleanup_for_rejoin(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 const char *disp;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
305 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
306 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
307
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
308 account = purple_conversation_get_account(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
309
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
310 purple_conversation_close_logs(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 open_log(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
313 gc = purple_account_get_connection(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
314
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
315 if ((disp = purple_connection_get_display_name(gc)) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
316 purple_conv_chat_set_nick(PURPLE_CONV_CHAT(conv), disp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
317 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
319 purple_conv_chat_set_nick(PURPLE_CONV_CHAT(conv),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
320 purple_account_get_username(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
323 purple_conv_chat_clear_users(PURPLE_CONV_CHAT(conv));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
324 purple_conv_chat_set_topic(PURPLE_CONV_CHAT(conv), NULL, NULL);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
325 PURPLE_CONV_CHAT(conv)->left = FALSE;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
326
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
327 purple_conversation_update(conv, PURPLE_CONV_UPDATE_CHATLEFT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
330 PurpleConversation *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
331 purple_conversation_new(PurpleConversationType type, PurpleAccount *account,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 const char *name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
333 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
334 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
335 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
336 PurpleConversationUiOps *ops;
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
337 struct _purple_hconv *hc;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
338
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
339 g_return_val_if_fail(type != PURPLE_CONV_TYPE_UNKNOWN, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340 g_return_val_if_fail(account != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 /* Check if this conversation already exists. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
344 if ((conv = purple_find_conversation_with_account(type, name, account)) != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 {
28019
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
346 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
347 !purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
348 purple_debug_warning("conversation", "Trying to create multiple "
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
349 "chats (%s) with the same name is deprecated and will be "
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
350 "removed in libpurple 3.0.0", name);
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
351 }
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
352
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
353 /*
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
354 * This hack is necessary because some prpls (MSN) have unnamed chats
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
355 * that all use the same name. A PurpleConversation for one of those
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
356 * is only ever re-used if the user has left, so calls to
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
357 * purple_conversation_new need to fall-through to creating a new
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
358 * chat.
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
359 * TODO 3.0.0: Remove this workaround and mandate unique names.
1082e1c25b30 Deprecate multiple chats having the same name and complain in the log.
Paul Aurich <paul@darkrain42.org>
parents: 27219
diff changeset
360 */
22029
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
361 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT ||
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
362 purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
22029
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
363 {
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
364 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
365 purple_conversation_chat_cleanup_for_rejoin(conv);
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
366
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
367 return conv;
fbef14f35c78 I am going to go ahead and commit+push this revision/fix of purple_conversation_new.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21560
diff changeset
368 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
371 gc = purple_account_get_connection(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 g_return_val_if_fail(gc != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
374 conv = g_new0(PurpleConversation, 1);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
375 PURPLE_DBUS_REGISTER_POINTER(conv, PurpleConversation);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
376
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 conv->type = type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 conv->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379 conv->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 conv->title = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 conv->data = g_hash_table_new_full(g_str_hash, g_str_equal,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382 g_free, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 /* copy features from the connection. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 conv->features = gc->flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
385
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
386 if (type == PURPLE_CONV_TYPE_IM)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
388 PurpleBuddyIcon *icon;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
389 conv->u.im = g_new0(PurpleConvIm, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390 conv->u.im->conv = conv;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
391 PURPLE_DBUS_REGISTER_POINTER(conv->u.im, PurpleConvIm);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
393 ims = g_list_prepend(ims, conv);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
394 if ((icon = purple_buddy_icons_find(account, name)))
16828
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
395 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
396 purple_conv_im_set_icon(conv->u.im, icon);
16828
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
397 /* purple_conv_im_set_icon refs the icon. */
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
398 purple_buddy_icon_unref(icon);
56823a55581a Rework purple_buddy_icons_find() to return a reference for the caller, which
Richard Laager <rlaager@wiktel.com>
parents: 16483
diff changeset
399 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
400
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
401 if (purple_prefs_get_bool("/purple/logging/log_ims"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
403 purple_conversation_set_logging(conv, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404 open_log(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
407 else if (type == PURPLE_CONV_TYPE_CHAT)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 const char *disp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
411 conv->u.chat = g_new0(PurpleConvChat, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 conv->u.chat->conv = conv;
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
413 conv->u.chat->users = g_hash_table_new_full(_purple_conversation_user_hash,
32170
f7c3aac5b22b conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <paul@darkrain42.org>
parents: 32168
diff changeset
414 _purple_conversation_user_equal, g_free, NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
415 PURPLE_DBUS_REGISTER_POINTER(conv->u.chat, PurpleConvChat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
417 chats = g_list_prepend(chats, conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
419 if ((disp = purple_connection_get_display_name(account->gc)))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
420 purple_conv_chat_set_nick(conv->u.chat, disp);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
421 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
422 purple_conv_chat_set_nick(conv->u.chat,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
423 purple_account_get_username(account));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
424
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
425 if (purple_prefs_get_bool("/purple/logging/log_chats"))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
426 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
427 purple_conversation_set_logging(conv, TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
428 open_log(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
429 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
430 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
431
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
432 conversations = g_list_prepend(conversations, conv);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
433
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
434 hc = g_new(struct _purple_hconv, 1);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
435 hc->name = g_strdup(purple_normalize(account, conv->name));
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
436 hc->account = account;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
437 hc->type = type;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
438
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
439 g_hash_table_insert(conversation_cache, hc, conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
440
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441 /* Auto-set the title. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
442 purple_conversation_autoset_title(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444 /* Don't move this.. it needs to be one of the last things done otherwise
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445 * it causes mysterious crashes on my system.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 * -- Gary
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
447 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 ops = conv->ui_ops = default_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449 if (ops != NULL && ops->create_conversation != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 ops->create_conversation(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
452 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 "conversation-created", conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455 return conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
456 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
457
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
458 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
459 purple_conversation_destroy(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
460 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
461 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
462 PurpleConversationUiOps *ops;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
463 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
464 const char *name;
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
465 struct _purple_hconv hc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
466
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
467 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
468
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
469 purple_request_close_with_handle(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
470
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
471 ops = purple_conversation_get_ui_ops(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
472 gc = purple_conversation_get_gc(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
473 name = purple_conversation_get_name(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
474
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
475 if (gc != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
476 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
477 /* Still connected */
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22029
diff changeset
478 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
479
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
480 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
481 {
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
482 if (purple_prefs_get_bool("/purple/conversations/im/send_typing"))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
483 serv_send_typing(gc, name, PURPLE_NOT_TYPING);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
484
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
485 if (gc && prpl_info->convo_closed != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
486 prpl_info->convo_closed(gc, name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
487 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
488 else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
489 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
490 int chat_id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
491 #if 0
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
492 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
493 * This is unfortunately necessary, because calling
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
494 * serv_chat_leave() calls this purple_conversation_destroy(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
495 * which leads to two calls here.. We can't just return after
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
496 * this, because then it'll return on the next pass. So, since
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
497 * serv_got_chat_left(), which is eventually called from the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
498 * prpl that serv_chat_leave() calls, removes this conversation
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
499 * from the gc's buddy_chats list, we're going to check to see
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
500 * if this exists in the list. If so, we want to return after
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
501 * calling this, because it'll be called again. If not, fall
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
502 * through, because it'll have already been removed, and we'd
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
503 * be on the 2nd pass.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
504 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
505 * Long paragraph. <-- Short sentence.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
506 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
507 * -- ChipX86
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
508 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
509
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
510 if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
511 serv_chat_leave(gc, chat_id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
512
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
513 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
514 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
515 #endif
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
516 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
517 * Instead of all of that, lets just close the window when
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
518 * the user tells us to, and let the prpl deal with the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
519 * internals on it's own time. Don't do this if the prpl already
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
520 * knows it left the chat.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
521 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
522 if (!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
523 serv_chat_leave(gc, chat_id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
524
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
525 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
526 * If they didn't call serv_got_chat_left by now, it's too late.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
527 * So we better do it for them before we destroy the thing.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
528 */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
529 if (!purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
530 serv_got_chat_left(gc, chat_id);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
531 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
532 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
533
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
534 /* remove from conversations and im/chats lists prior to emit */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
535 conversations = g_list_remove(conversations, conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
536
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
537 if(conv->type==PURPLE_CONV_TYPE_IM)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
538 ims = g_list_remove(ims, conv);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
539 else if(conv->type==PURPLE_CONV_TYPE_CHAT)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
540 chats = g_list_remove(chats, conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
541
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
542 hc.name = (gchar *)purple_normalize(conv->account, conv->name);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
543 hc.account = conv->account;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
544 hc.type = conv->type;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
545
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
546 g_hash_table_remove(conversation_cache, &hc);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
547
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
548 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549 "deleting-conversation", conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
550
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
551 g_free(conv->name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
552 g_free(conv->title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
553
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
554 conv->name = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
555 conv->title = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
556
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
557 if (conv->type == PURPLE_CONV_TYPE_IM) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
558 purple_conv_im_stop_typing_timeout(conv->u.im);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
559 purple_conv_im_stop_send_typed_timeout(conv->u.im);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
560
16373
c9b4ff420140 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
561 purple_buddy_icon_unref(conv->u.im->icon);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
562 conv->u.im->icon = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
563
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
564 PURPLE_DBUS_UNREGISTER_POINTER(conv->u.im);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
565 g_free(conv->u.im);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
566 conv->u.im = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
567 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
568 else if (conv->type == PURPLE_CONV_TYPE_CHAT) {
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
569 g_hash_table_destroy(conv->u.chat->users);
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
570 conv->u.chat->users = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
571
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
572 g_list_foreach(conv->u.chat->in_room, (GFunc)purple_conv_chat_cb_destroy, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
573 g_list_free(conv->u.chat->in_room);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
574
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
575 g_list_foreach(conv->u.chat->ignored, (GFunc)g_free, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
576 g_list_free(conv->u.chat->ignored);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
577
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
578 conv->u.chat->in_room = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
579 conv->u.chat->ignored = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
580
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
581 g_free(conv->u.chat->who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
582 conv->u.chat->who = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
583
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
584 g_free(conv->u.chat->topic);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
585 conv->u.chat->topic = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
586
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
587 g_free(conv->u.chat->nick);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
588
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
589 PURPLE_DBUS_UNREGISTER_POINTER(conv->u.chat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
590 g_free(conv->u.chat);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
591 conv->u.chat = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
592 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
593
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
594 g_hash_table_destroy(conv->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
595 conv->data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
596
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
597 if (ops != NULL && ops->destroy_conversation != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
598 ops->destroy_conversation(conv);
31894
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
599 conv->ui_data = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
600
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
601 purple_conversation_close_logs(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
602
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
603 purple_conversation_clear_message_history(conv);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
604
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
605 PURPLE_DBUS_UNREGISTER_POINTER(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
606 g_free(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
607 conv = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
608 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
609
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
610
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
611 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
612 purple_conversation_present(PurpleConversation *conv) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
613 PurpleConversationUiOps *ops;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
614
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
615 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
616
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
617 ops = purple_conversation_get_ui_ops(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
618 if(ops && ops->present)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
619 ops->present(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
620 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
621
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
622
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
623 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
624 purple_conversation_set_features(PurpleConversation *conv, PurpleConnectionFlags features)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
625 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
626 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
627
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
628 conv->features = features;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
629
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
630 purple_conversation_update(conv, PURPLE_CONV_UPDATE_FEATURES);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
632
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
634 PurpleConnectionFlags
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
635 purple_conversation_get_features(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
636 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 g_return_val_if_fail(conv != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 return conv->features;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
639 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
642 PurpleConversationType
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
643 purple_conversation_get_type(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
644 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
645 g_return_val_if_fail(conv != NULL, PURPLE_CONV_TYPE_UNKNOWN);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
646
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
647 return conv->type;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
649
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
650 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
651 purple_conversation_set_ui_ops(PurpleConversation *conv,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
652 PurpleConversationUiOps *ops)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
653 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
654 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
655
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
656 if (conv->ui_ops == ops)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
657 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
658
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
659 if (conv->ui_ops != NULL && conv->ui_ops->destroy_conversation != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
660 conv->ui_ops->destroy_conversation(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
661
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
662 conv->ui_data = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
663
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
664 conv->ui_ops = ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
665 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
666
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
667 PurpleConversationUiOps *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
668 purple_conversation_get_ui_ops(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
669 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
670 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
671
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
672 return conv->ui_ops;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
673 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
674
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
675 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
676 purple_conversation_set_account(PurpleConversation *conv, PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
677 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
678 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
679
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
680 if (account == purple_conversation_get_account(conv))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
681 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
682
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
683 conv->account = account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
684
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
685 purple_conversation_update(conv, PURPLE_CONV_UPDATE_ACCOUNT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
686 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
687
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
688 PurpleAccount *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
689 purple_conversation_get_account(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
690 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
691 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
692
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
693 return conv->account;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
694 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
695
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
696 PurpleConnection *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
697 purple_conversation_get_gc(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
698 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
699 PurpleAccount *account;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
700
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
701 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
702
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
703 account = purple_conversation_get_account(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
704
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
705 if (account == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
706 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
707
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
708 return account->gc;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
709 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
710
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
711 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
712 purple_conversation_set_title(PurpleConversation *conv, const char *title)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
713 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
714 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
715 g_return_if_fail(title != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
716
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
717 g_free(conv->title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
718 conv->title = g_strdup(title);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
719
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
720 purple_conversation_update(conv, PURPLE_CONV_UPDATE_TITLE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
721 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
722
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
723 const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
724 purple_conversation_get_title(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
725 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
726 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
727
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
728 return conv->title;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
729 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
730
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
731 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
732 purple_conversation_autoset_title(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
733 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
734 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
735 PurpleBuddy *b;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
736 PurpleChat *chat;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
737 const char *text = NULL, *name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
738
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
739 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
740
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
741 account = purple_conversation_get_account(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
742 name = purple_conversation_get_name(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
743
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
744 if(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
745 if(account && ((b = purple_find_buddy(account, name)) != NULL))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
746 text = purple_buddy_get_contact_alias(b);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
747 } else if(purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
748 if(account && ((chat = purple_blist_find_chat(account, name)) != NULL))
25299
5ebfa814b9e8 Finish off the libpurple updates for the hidden blist structs
Gary Kramlich <grim@reaperworld.com>
parents: 23782
diff changeset
749 text = purple_chat_get_name(chat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
750 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
751
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
752
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
753 if(text == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
754 text = name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
755
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
756 purple_conversation_set_title(conv, text);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
757 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
758
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
759 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
760 purple_conversation_foreach(void (*func)(PurpleConversation *conv))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
761 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
762 PurpleConversation *conv;
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
763 GList *l;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
764
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
765 g_return_if_fail(func != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
766
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
767 for (l = purple_get_conversations(); l != NULL; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
768 conv = (PurpleConversation *)l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
769
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
770 func(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
771 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
772 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
773
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
774 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
775 purple_conversation_set_name(PurpleConversation *conv, const char *name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
776 {
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
777 struct _purple_hconv *hc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
778 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
779
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
780 hc = g_new(struct _purple_hconv, 1);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
781 hc->type = conv->type;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
782 hc->account = conv->account;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
783 hc->name = (gchar *)purple_normalize(conv->account, conv->name);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
784
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
785 g_hash_table_remove(conversation_cache, hc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
786 g_free(conv->name);
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
787
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
788 conv->name = g_strdup(name);
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
789 hc->name = g_strdup(purple_normalize(conv->account, conv->name));
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
790 g_hash_table_insert(conversation_cache, hc, conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
791
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
792 purple_conversation_autoset_title(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
793 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
794
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
795 const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
796 purple_conversation_get_name(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
797 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
798 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
799
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
800 return conv->name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
801 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
802
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
803 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
804 purple_conversation_set_logging(PurpleConversation *conv, gboolean log)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
805 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
806 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
807
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
808 if (conv->logging != log)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
809 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
810 conv->logging = log;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
811 purple_conversation_update(conv, PURPLE_CONV_UPDATE_LOGGING);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
812 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
813 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
814
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
815 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
816 purple_conversation_is_logging(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
817 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
818 g_return_val_if_fail(conv != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
819
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
820 return conv->logging;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
821 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
822
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
823 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
824 purple_conversation_close_logs(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
825 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
826 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
827
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
828 g_list_foreach(conv->logs, (GFunc)purple_log_free, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
829 g_list_free(conv->logs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
830 conv->logs = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
831 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
832
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
833 PurpleConvIm *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
834 purple_conversation_get_im_data(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
835 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
836 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
837
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
838 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_IM)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
839 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
840
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
841 return conv->u.im;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
842 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
843
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
844 PurpleConvChat *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
845 purple_conversation_get_chat_data(const PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
846 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
847 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
848
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
849 if (purple_conversation_get_type(conv) != PURPLE_CONV_TYPE_CHAT)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
850 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
851
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
852 return conv->u.chat;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
853 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
854
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
855 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
856 purple_conversation_set_data(PurpleConversation *conv, const char *key,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
857 gpointer data)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
858 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
859 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
860 g_return_if_fail(key != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
861
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
862 g_hash_table_replace(conv->data, g_strdup(key), data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
863 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
864
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
865 gpointer
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
866 purple_conversation_get_data(PurpleConversation *conv, const char *key)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
867 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
868 g_return_val_if_fail(conv != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
869 g_return_val_if_fail(key != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
870
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
871 return g_hash_table_lookup(conv->data, key);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
872 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
873
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
874 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
875 purple_get_conversations(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
876 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
877 return conversations;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
878 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
879
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
880 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
881 purple_get_ims(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
882 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
883 return ims;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
884 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
885
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
886 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
887 purple_get_chats(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
888 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
889 return chats;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
890 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
891
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
892
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
893 PurpleConversation *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
894 purple_find_conversation_with_account(PurpleConversationType type,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
895 const char *name,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
896 const PurpleAccount *account)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
897 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
898 PurpleConversation *c = NULL;
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
899 struct _purple_hconv hc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
900
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
901 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
902
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
903 hc.name = (gchar *)purple_normalize(account, name);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
904 hc.account = account;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
905 hc.type = type;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
906
22815
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
907 switch (type) {
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
908 case PURPLE_CONV_TYPE_IM:
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
909 case PURPLE_CONV_TYPE_CHAT:
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
910 c = g_hash_table_lookup(conversation_cache, &hc);
22815
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
911 break;
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
912 case PURPLE_CONV_TYPE_ANY:
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
913 hc.type = PURPLE_CONV_TYPE_IM;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
914 c = g_hash_table_lookup(conversation_cache, &hc);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
915 if (!c) {
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
916 hc.type = PURPLE_CONV_TYPE_CHAT;
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
917 c = g_hash_table_lookup(conversation_cache, &hc);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
918 }
22815
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
919 break;
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
920 default:
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
921 g_return_val_if_reached(NULL);
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
922 }
f67edee0224e When searching for a conversation, search only in the list of the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22740
diff changeset
923
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
924 return c;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
925 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
926
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
927 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
928 purple_conversation_write(PurpleConversation *conv, const char *who,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
929 const char *message, PurpleMessageFlags flags,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
930 time_t mtime)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
931 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
932 PurplePluginProtocolInfo *prpl_info = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
933 PurpleConnection *gc = NULL;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
934 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
935 PurpleConversationUiOps *ops;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
936 const char *alias;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
937 char *displayed = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
938 PurpleBuddy *b;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
939 int plugin_return;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
940 PurpleConversationType type;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
941 /* int logging_font_options = 0; */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
942
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
943 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
944 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
945
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
946 ops = purple_conversation_get_ui_ops(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
947
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
948 account = purple_conversation_get_account(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
949 type = purple_conversation_get_type(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
950
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
951 if (account != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
952 gc = purple_account_get_connection(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
953
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
954 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
22645
f75509f776cc When you try to execute a command (e.g., /part etc.) in a chat on a
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 22317
diff changeset
955 (gc != NULL && !g_slist_find(gc->buddy_chats, conv)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
956 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
957
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
958 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM &&
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
959 !g_list_find(purple_get_conversations(), conv))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
960 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
961
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
962 displayed = g_strdup(message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
963
19606
e918e38a56b0 writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@wiktel.com>
parents: 19511
diff changeset
964 if (who == NULL || *who == '\0')
e918e38a56b0 writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@wiktel.com>
parents: 19511
diff changeset
965 who = purple_conversation_get_name(conv);
e918e38a56b0 writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@wiktel.com>
parents: 19511
diff changeset
966 alias = who;
e918e38a56b0 writing-im-msg now receives the conversation name as the who argument if
Richard Laager <rlaager@wiktel.com>
parents: 19511
diff changeset
967
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
968 plugin_return =
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
969 GPOINTER_TO_INT(purple_signal_emit_return_1(
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
970 purple_conversations_get_handle(),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
971 (type == PURPLE_CONV_TYPE_IM ? "writing-im-msg" : "writing-chat-msg"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
972 account, who, &displayed, conv, flags));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
973
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
974 if (displayed == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
975 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
976
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
977 if (plugin_return) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
978 g_free(displayed);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
979 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
980 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
981
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
982 if (account != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
983 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_prpl(purple_account_get_protocol_id(account)));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
984
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
985 if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM ||
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
986 !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
987
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
988 if (flags & PURPLE_MESSAGE_SEND) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
989 b = purple_find_buddy(account,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
990 purple_account_get_username(account));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
991
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
992 if (purple_account_get_alias(account) != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
993 alias = account->alias;
25385
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 25299
diff changeset
994 else if (b != NULL && !purple_strequal(purple_buddy_get_name(b), purple_buddy_get_contact_alias(b)))
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
995 alias = purple_buddy_get_contact_alias(b);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
996 else if (purple_connection_get_display_name(gc) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
997 alias = purple_connection_get_display_name(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
998 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
999 alias = purple_account_get_username(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1000 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1001 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1002 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1003 b = purple_find_buddy(account, who);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1004
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1005 if (b != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1006 alias = purple_buddy_get_contact_alias(b);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1007 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1008 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1009 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1010
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1011 if (!(flags & PURPLE_MESSAGE_NO_LOG) && purple_conversation_is_logging(conv)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1012 GList *log;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1013
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1014 if (conv->logs == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1015 open_log(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1016
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1017 log = conv->logs;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1018 while (log != NULL) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1019 purple_log_write((PurpleLog *)log->data, flags, alias, mtime, displayed);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1020 log = log->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1021 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1022 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1023
19416
3489182dc187 A conversation shouldn't need ui-ops for logging the messages.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19413
diff changeset
1024 if (ops && ops->write_conv)
3489182dc187 A conversation shouldn't need ui-ops for logging the messages.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19413
diff changeset
1025 ops->write_conv(conv, who, alias, displayed, flags, mtime);
21263
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
1026
1812b8ccfd7a Show alias in restored conversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 21244
diff changeset
1027 add_message_to_history(conv, who, alias, message, flags, mtime);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1028
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1029 purple_signal_emit(purple_conversations_get_handle(),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1030 (type == PURPLE_CONV_TYPE_IM ? "wrote-im-msg" : "wrote-chat-msg"),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1031 account, who, displayed, conv, flags);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1032
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1033 g_free(displayed);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1034 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1035
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1036 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1037 purple_conversation_has_focus(PurpleConversation *conv)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1038 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1039 gboolean ret = FALSE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1040 PurpleConversationUiOps *ops;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1041
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1042 g_return_val_if_fail(conv != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1043
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1044 ops = purple_conversation_get_ui_ops(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1045
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1046 if (ops != NULL && ops->has_focus != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1047 ret = ops->has_focus(conv);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1048
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1049 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1050 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1051
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1052 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1053 * TODO: Need to make sure calls to this function happen in the core
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1054 * instead of the UI. That way UIs have less work to do, and the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1055 * core/UI split is cleaner. Also need to make sure this is called
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1056 * when chats are added/removed from the blist.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1057 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1058 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1059 purple_conversation_update(PurpleConversation *conv, PurpleConvUpdateType type)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1060 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1061 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1062
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1063 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1064 "conversation-updated", conv, type);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1065 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1066
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1067 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1068 * IM Conversation API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1069 **************************************************************************/
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1070 PurpleConversation *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1071 purple_conv_im_get_conversation(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1072 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1073 g_return_val_if_fail(im != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1074
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1075 return im->conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1076 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1077
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1078 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1079 purple_conv_im_set_icon(PurpleConvIm *im, PurpleBuddyIcon *icon)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1080 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1081 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1082
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1083 if (im->icon != icon)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1084 {
16373
c9b4ff420140 The buddy icon code as it stands, with lots of bugs and design flaws.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
1085 purple_buddy_icon_unref(im->icon);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1086
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1087 im->icon = (icon == NULL ? NULL : purple_buddy_icon_ref(icon));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1088 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1089
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1090 purple_conversation_update(purple_conv_im_get_conversation(im),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1091 PURPLE_CONV_UPDATE_ICON);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1092 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1093
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1094 PurpleBuddyIcon *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1095 purple_conv_im_get_icon(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1096 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1097 g_return_val_if_fail(im != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1098
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1099 return im->icon;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1100 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1101
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1102 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1103 purple_conv_im_set_typing_state(PurpleConvIm *im, PurpleTypingState state)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1104 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1105 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1106
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1107 if (im->typing_state != state)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1108 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1109 im->typing_state = state;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1110
17070
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1111 switch (state)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1112 {
17070
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1113 case PURPLE_TYPING:
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1114 purple_signal_emit(purple_conversations_get_handle(),
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1115 "buddy-typing", im->conv->account, im->conv->name);
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1116 break;
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1117 case PURPLE_TYPED:
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1118 purple_signal_emit(purple_conversations_get_handle(),
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1119 "buddy-typed", im->conv->account, im->conv->name);
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1120 break;
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1121 case PURPLE_NOT_TYPING:
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1122 purple_signal_emit(purple_conversations_get_handle(),
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1123 "buddy-typing-stopped", im->conv->account, im->conv->name);
73556f13c3b5 Use switch() rather than a series of if() statements which hit all the values of the enum
Evan Schoenberg <evan.s@dreskin.net>
parents: 16828
diff changeset
1124 break;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1125 }
27115
2ab648c328cc Consistently emit conversation-updated for typing state changes.
Florian Quèze <florian@instantbird.org>
parents: 26803
diff changeset
1126
2ab648c328cc Consistently emit conversation-updated for typing state changes.
Florian Quèze <florian@instantbird.org>
parents: 26803
diff changeset
1127 purple_conv_im_update_typing(im);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1128 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1129 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1130
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1131 PurpleTypingState
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1132 purple_conv_im_get_typing_state(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1133 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1134 g_return_val_if_fail(im != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1135
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1136 return im->typing_state;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1137 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1138
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1139 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1140 purple_conv_im_start_typing_timeout(PurpleConvIm *im, int timeout)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1141 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1142 PurpleConversation *conv;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1143
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1144 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1145
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1146 if (im->typing_timeout > 0)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1147 purple_conv_im_stop_typing_timeout(im);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1148
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1149 conv = purple_conv_im_get_conversation(im);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1150
18006
f2d8658b3a86 merge of '62e9d17cd37551991c5040ce6ca48e6d7578dde3'
Richard Laager <rlaager@wiktel.com>
parents: 17095
diff changeset
1151 im->typing_timeout = purple_timeout_add_seconds(timeout, reset_typing_cb, conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1152 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1153
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1154 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1155 purple_conv_im_stop_typing_timeout(PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1156 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1157 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1158
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1159 if (im->typing_timeout == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1160 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1161
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1162 purple_timeout_remove(im->typing_timeout);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1163 im->typing_timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1164 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1165
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1166 guint
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1167 purple_conv_im_get_typing_timeout(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1168 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1169 g_return_val_if_fail(im != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1170
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1171 return im->typing_timeout;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1172 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1173
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1174 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1175 purple_conv_im_set_type_again(PurpleConvIm *im, unsigned int val)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1176 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1177 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1178
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1179 if (val == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1180 im->type_again = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1181 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1182 im->type_again = time(NULL) + val;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1183 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1184
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1185 time_t
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1186 purple_conv_im_get_type_again(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1187 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1188 g_return_val_if_fail(im != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1189
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1190 return im->type_again;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1191 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1192
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1193 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1194 purple_conv_im_start_send_typed_timeout(PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1195 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1196 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1197
25861
7f552614ec8a applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents: 23782
diff changeset
1198 im->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS,
7f552614ec8a applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents: 23782
diff changeset
1199 send_typed_cb,
7f552614ec8a applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b
Ethan Blanton <elb@pidgin.im>
parents: 23782
diff changeset
1200 purple_conv_im_get_conversation(im));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1201 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1202
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1203 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1204 purple_conv_im_stop_send_typed_timeout(PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1205 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1206 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1207
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1208 if (im->send_typed_timeout == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1209 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1210
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1211 purple_timeout_remove(im->send_typed_timeout);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1212 im->send_typed_timeout = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1213 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1214
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1215 guint
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1216 purple_conv_im_get_send_typed_timeout(const PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1217 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1218 g_return_val_if_fail(im != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1219
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1220 return im->send_typed_timeout;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1221 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1222
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1223 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1224 purple_conv_im_update_typing(PurpleConvIm *im)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1225 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1226 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1227
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1228 purple_conversation_update(purple_conv_im_get_conversation(im),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1229 PURPLE_CONV_UPDATE_TYPING);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1230 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1231
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1232 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1233 purple_conv_im_write(PurpleConvIm *im, const char *who, const char *message,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1234 PurpleMessageFlags flags, time_t mtime)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1235 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1236 PurpleConversation *c;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1237
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1238 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1239 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1240
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1241 c = purple_conv_im_get_conversation(im);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1242
31854
7e20e5bbaf2b Fix indenting.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31823
diff changeset
1243 if ((flags & PURPLE_MESSAGE_RECV) == PURPLE_MESSAGE_RECV) {
31685
06791ebf7681 applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evan.s@dreskin.net>
parents: 31684
diff changeset
1244 purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING);
06791ebf7681 applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evan.s@dreskin.net>
parents: 31684
diff changeset
1245 }
06791ebf7681 applied changes from 471aa5f04627823959bd9accda5d5e5630f119d5
Evan Schoenberg <evan.s@dreskin.net>
parents: 31684
diff changeset
1246
18823
e1062ac14080 Correct an inaccurate comment.
Will Thompson <will.thompson@collabora.co.uk>
parents: 18496
diff changeset
1247 /* Pass this on to either the ops structure or the default write func. */
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1248 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1249 c->ui_ops->write_im(c, who, message, flags, mtime);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1250 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1251 purple_conversation_write(c, who, message, flags, mtime);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1252 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1253
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1254 gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1255 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1256 PurpleConversation *conv;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1257
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1258 g_return_val_if_fail(who != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1259 g_return_val_if_fail(account !=NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1260 g_return_val_if_fail(what != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1261
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1262 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1263 if (conv != NULL)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1264 purple_conversation_write(conv, NULL, what, PURPLE_MESSAGE_ERROR, time(NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1265 else
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1266 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1267
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1268 return TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1269 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1270
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1271 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1272 purple_conv_im_send(PurpleConvIm *im, const char *message)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1273 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1274 purple_conv_im_send_with_flags(im, message, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1275 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1276
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1277 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1278 purple_conv_send_confirm_cb(gpointer *data)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1279 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1280 PurpleConversation *conv = data[0];
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1281 char *message = data[1];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1282
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1283 g_free(data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1284 common_send(conv, message, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1285 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1286
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1287 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1288 purple_conv_send_confirm(PurpleConversation *conv, const char *message)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1289 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1290 char *text;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1291 gpointer *data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1292
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1293 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1294 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1295
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1296 if (conv->ui_ops != NULL && conv->ui_ops->send_confirm != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1297 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1298 conv->ui_ops->send_confirm(conv, message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1299 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1300 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1301
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1302 text = g_strdup_printf("You are about to send the following message:\n%s", message);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1303 data = g_new0(gpointer, 2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1304 data[0] = conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1305 data[1] = (gpointer)message;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1306
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
1307 purple_request_action(conv, NULL, _("Send Message"), text, 0,
16442
08db93bbd798 Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents: 16427
diff changeset
1308 purple_conversation_get_account(conv), NULL, conv,
21099
51cf02dbdb0e disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents: 21095
diff changeset
1309 data, 2,
16442
08db93bbd798 Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents: 16427
diff changeset
1310 _("_Send Message"), G_CALLBACK(purple_conv_send_confirm_cb),
08db93bbd798 Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evan.s@dreskin.net>
parents: 16427
diff changeset
1311 _("Cancel"), NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1312 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1313
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1314 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1315 purple_conv_im_send_with_flags(PurpleConvIm *im, const char *message, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1316 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1317 g_return_if_fail(im != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1318 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1319
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1320 common_send(purple_conv_im_get_conversation(im), message, flags);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1321 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1322
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1323 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1324 purple_conv_custom_smiley_add(PurpleConversation *conv, const char *smile,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1325 const char *cksum_type, const char *chksum,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1326 gboolean remote)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1327 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1328 if (conv == NULL || smile == NULL || !*smile) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1329 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1330 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1331
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1332 /* TODO: check if the icon is in the cache and return false if so */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1333 /* TODO: add an icon cache (that doesn't suck) */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1334 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_add !=NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1335 return conv->ui_ops->custom_smiley_add(conv, smile, remote);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1336 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1337 purple_debug_info("conversation", "Could not find add custom smiley function");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1338 return FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1339 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1340
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1341 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1342
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1343 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1344 purple_conv_custom_smiley_write(PurpleConversation *conv, const char *smile,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1345 const guchar *data, gsize size)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1346 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1347 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1348 g_return_if_fail(smile != NULL && *smile);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1349
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1350 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_write != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1351 conv->ui_ops->custom_smiley_write(conv, smile, data, size);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1352 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1353 purple_debug_info("conversation", "Could not find the smiley write function");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1354 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1355
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1356 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1357 purple_conv_custom_smiley_close(PurpleConversation *conv, const char *smile)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1358 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1359 g_return_if_fail(conv != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1360 g_return_if_fail(smile != NULL && *smile);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1361
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1362 if (conv->ui_ops != NULL && conv->ui_ops->custom_smiley_close != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1363 conv->ui_ops->custom_smiley_close(conv, smile);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1364 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1365 purple_debug_info("conversation", "Could not find custom smiley close function");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1366 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1367
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1368
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1369 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1370 * Chat Conversation API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1371 **************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1372
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1373 PurpleConversation *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1374 purple_conv_chat_get_conversation(const PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1375 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1376 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1377
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1378 return chat->conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1379 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1380
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1381 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1382 purple_conv_chat_set_users(PurpleConvChat *chat, GList *users)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1383 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1384 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1385
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1386 chat->in_room = users;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1387
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1388 return users;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1389 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1390
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1391 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1392 purple_conv_chat_get_users(const PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1393 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1394 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1395
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1396 return chat->in_room;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1397 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1398
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1399 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1400 purple_conv_chat_ignore(PurpleConvChat *chat, const char *name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1401 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1402 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1403 g_return_if_fail(name != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1404
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1405 /* Make sure the user isn't already ignored. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1406 if (purple_conv_chat_is_user_ignored(chat, name))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1407 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1408
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1409 purple_conv_chat_set_ignored(chat,
18115
871d9aa8e51c Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e:
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1410 g_list_append(chat->ignored, g_strdup(name)));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1411 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1412
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1413 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1414 purple_conv_chat_unignore(PurpleConvChat *chat, const char *name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1415 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1416 GList *item;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1417
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1418 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1419 g_return_if_fail(name != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1420
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1421 /* Make sure the user is actually ignored. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1422 if (!purple_conv_chat_is_user_ignored(chat, name))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1423 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1424
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1425 item = g_list_find(purple_conv_chat_get_ignored(chat),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1426 purple_conv_chat_get_ignored_user(chat, name));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1427
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1428 purple_conv_chat_set_ignored(chat,
18115
871d9aa8e51c Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e:
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1429 g_list_remove_link(chat->ignored, item));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1430
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1431 g_free(item->data);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1432 g_list_free_1(item);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1433 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1434
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1435 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1436 purple_conv_chat_set_ignored(PurpleConvChat *chat, GList *ignored)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1437 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1438 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1439
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1440 chat->ignored = ignored;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1441
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1442 return ignored;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1443 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1444
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1445 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1446 purple_conv_chat_get_ignored(const PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1447 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1448 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1449
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1450 return chat->ignored;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1451 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1452
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1453 const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1454 purple_conv_chat_get_ignored_user(const PurpleConvChat *chat, const char *user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1455 {
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1456 GList *ignored;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1457
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1458 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1459 g_return_val_if_fail(user != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1460
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1461 for (ignored = purple_conv_chat_get_ignored(chat);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1462 ignored != NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1463 ignored = ignored->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1464
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1465 const char *ign = (const char *)ignored->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1466
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1467 if (!purple_utf8_strcasecmp(user, ign) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1468 ((*ign == '+' || *ign == '%') && !purple_utf8_strcasecmp(user, ign + 1)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1469 return ign;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1470
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1471 if (*ign == '@') {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1472 ign++;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1473
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1474 if ((*ign == '+' && !purple_utf8_strcasecmp(user, ign + 1)) ||
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1475 (*ign != '+' && !purple_utf8_strcasecmp(user, ign)))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1476 return ign;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1477 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1478 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1479
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1480 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1481 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1482
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1483 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1484 purple_conv_chat_is_user_ignored(const PurpleConvChat *chat, const char *user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1485 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1486 g_return_val_if_fail(chat != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1487 g_return_val_if_fail(user != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1488
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1489 return (purple_conv_chat_get_ignored_user(chat, user) != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1490 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1491
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1492 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1493 purple_conv_chat_set_topic(PurpleConvChat *chat, const char *who, const char *topic)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1494 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1495 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1496
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1497 g_free(chat->who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1498 g_free(chat->topic);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1499
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1500 chat->who = g_strdup(who);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1501 chat->topic = g_strdup(topic);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1502
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1503 purple_conversation_update(purple_conv_chat_get_conversation(chat),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1504 PURPLE_CONV_UPDATE_TOPIC);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1505
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1506 purple_signal_emit(purple_conversations_get_handle(), "chat-topic-changed",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1507 chat->conv, chat->who, chat->topic);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1508 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1509
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1510 const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1511 purple_conv_chat_get_topic(const PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1512 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1513 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1514
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1515 return chat->topic;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1516 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1517
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1518 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1519 purple_conv_chat_set_id(PurpleConvChat *chat, int id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1520 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1521 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1522
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1523 chat->id = id;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1524 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1525
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1526 int
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1527 purple_conv_chat_get_id(const PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1528 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1529 g_return_val_if_fail(chat != NULL, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1530
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1531 return chat->id;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1532 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1533
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1534 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1535 purple_conv_chat_write(PurpleConvChat *chat, const char *who, const char *message,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1536 PurpleMessageFlags flags, time_t mtime)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1537 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1538 PurpleAccount *account;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1539 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1540 PurpleConnection *gc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1541
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1542 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1543 g_return_if_fail(who != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1544 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1545
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1546 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1547 gc = purple_conversation_get_gc(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1548 account = purple_connection_get_account(gc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1549
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1550 /* Don't display this if the person who wrote it is ignored. */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1551 if (purple_conv_chat_is_user_ignored(chat, who))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1552 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1553
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1554 if (!(flags & PURPLE_MESSAGE_WHISPER)) {
25866
1cf0b4f71d16 *** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25861
diff changeset
1555 const char *str;
1cf0b4f71d16 *** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25861
diff changeset
1556
1cf0b4f71d16 *** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25861
diff changeset
1557 str = purple_normalize(account, who);
1cf0b4f71d16 *** Plucked rev 0257ab6e (wabz@pidgin.im):
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 25861
diff changeset
1558
26803
1ba4bbd3b0cd Chat's nick is normalized. So normalize before comparing with it.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26623
diff changeset
1559 if (purple_strequal(str, chat->nick)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1560 flags |= PURPLE_MESSAGE_SEND;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1561 } else {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1562 flags |= PURPLE_MESSAGE_RECV;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1563
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1564 if (purple_utf8_has_word(message, chat->nick))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1565 flags |= PURPLE_MESSAGE_NICK;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1566 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1567 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1568
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1569 /* Pass this on to either the ops structure or the default write func. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1570 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1571 conv->ui_ops->write_chat(conv, who, message, flags, mtime);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1572 else
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1573 purple_conversation_write(conv, who, message, flags, mtime);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1574 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1575
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1576 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1577 purple_conv_chat_send(PurpleConvChat *chat, const char *message)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1578 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1579 purple_conv_chat_send_with_flags(chat, message, 0);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1580 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1581
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1582 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1583 purple_conv_chat_send_with_flags(PurpleConvChat *chat, const char *message, PurpleMessageFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1584 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1585 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1586 g_return_if_fail(message != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1587
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1588 common_send(purple_conv_chat_get_conversation(chat), message, flags);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1589 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1590
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1591 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1592 purple_conv_chat_add_user(PurpleConvChat *chat, const char *user,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1593 const char *extra_msg, PurpleConvChatBuddyFlags flags,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1594 gboolean new_arrival)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1595 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1596 GList *users = g_list_append(NULL, (char *)user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1597 GList *extra_msgs = g_list_append(NULL, (char *)extra_msg);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1598 GList *flags2 = g_list_append(NULL, GINT_TO_POINTER(flags));
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1599
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1600 purple_conv_chat_add_users(chat, users, extra_msgs, flags2, new_arrival);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1601
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1602 g_list_free(users);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1603 g_list_free(extra_msgs);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1604 g_list_free(flags2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1605 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1606
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1607 static int
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1608 purple_conv_chat_cb_compare(PurpleConvChatBuddy *a, PurpleConvChatBuddy *b)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1609 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1610 PurpleConvChatBuddyFlags f1 = 0, f2 = 0;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1611 char *user1 = NULL, *user2 = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1612 gint ret = 0;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1613
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1614 if (a) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1615 f1 = a->flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1616 if (a->alias_key)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1617 user1 = a->alias_key;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1618 else if (a->name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1619 user1 = a->name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1620 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1621
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1622 if (b) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1623 f2 = b->flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1624 if (b->alias_key)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1625 user2 = b->alias_key;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1626 else if (b->name)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1627 user2 = b->name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1628 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1629
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1630 if (user1 == NULL || user2 == NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1631 if (!(user1 == NULL && user2 == NULL))
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1632 ret = (user1 == NULL) ? -1: 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1633 } else if (f1 != f2) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1634 /* sort more important users first */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1635 ret = (f1 > f2) ? -1 : 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1636 } else if (a->buddy != b->buddy) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1637 ret = a->buddy ? -1 : 1;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1638 } else {
17095
7ade887fd3f6 Replace strcasecmp() calls with glib equivalents.
Richard Laager <rlaager@wiktel.com>
parents: 17070
diff changeset
1639 ret = purple_utf8_strcasecmp(user1, user2);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1640 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1641
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1642 return ret;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1643 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1644
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1645 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1646 purple_conv_chat_add_users(PurpleConvChat *chat, GList *users, GList *extra_msgs,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1647 GList *flags, gboolean new_arrivals)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1648 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1649 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1650 PurpleConversationUiOps *ops;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1651 PurpleConvChatBuddy *cbuddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1652 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1653 PurplePluginProtocolInfo *prpl_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1654 GList *ul, *fl;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1655 GList *cbuddies = NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1656
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1657 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1658 g_return_if_fail(users != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1659
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1660 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1661 ops = purple_conversation_get_ui_ops(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1662
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1663 gc = purple_conversation_get_gc(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1664 g_return_if_fail(gc != NULL);
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22029
diff changeset
1665 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1666 g_return_if_fail(prpl_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1667
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1668 ul = users;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1669 fl = flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1670 while ((ul != NULL) && (fl != NULL)) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1671 const char *user = (const char *)ul->data;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1672 const char *alias = user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1673 gboolean quiet;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1674 PurpleConvChatBuddyFlags flag = GPOINTER_TO_INT(fl->data);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1675 const char *extra_msg = (extra_msgs ? extra_msgs->data : NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1676
17709
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1677 if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
25385
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 25299
diff changeset
1678 if (purple_strequal(chat->nick, purple_normalize(conv->account, user))) {
17709
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1679 const char *alias2 = purple_account_get_alias(conv->account);
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1680 if (alias2 != NULL)
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1681 alias = alias2;
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1682 else
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1683 {
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1684 const char *display_name = purple_connection_get_display_name(gc);
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1685 if (display_name != NULL)
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1686 alias = display_name;
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1687 }
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1688 } else {
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1689 PurpleBuddy *buddy;
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1690 if ((buddy = purple_find_buddy(gc->account, user)) != NULL)
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1691 alias = purple_buddy_get_contact_alias(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1692 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1693 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1694
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1695 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(),
23417
1c6918e48104 This should be a boolean or, not a bitwise or.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23299
diff changeset
1696 "chat-buddy-joining", conv, user, flag)) ||
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1697 purple_conv_chat_is_user_ignored(chat, user);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1698
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1699 cbuddy = purple_conv_chat_cb_new(user, alias, flag);
18305
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
1700 cbuddy->buddy = purple_find_buddy(conv->account, user) != NULL;
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1701
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1702 chat->in_room = g_list_prepend(chat->in_room, cbuddy);
32170
f7c3aac5b22b conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <paul@darkrain42.org>
parents: 32168
diff changeset
1703 g_hash_table_replace(chat->users, g_strdup(cbuddy->name), cbuddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1704
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1705 cbuddies = g_list_prepend(cbuddies, cbuddy);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1706
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1707 if (!quiet && new_arrivals) {
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1708 char *alias_esc = g_markup_escape_text(alias, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1709 char *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1710
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1711 if (extra_msg == NULL)
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1712 tmp = g_strdup_printf(_("%s entered the room."), alias_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1713 else {
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1714 char *extra_msg_esc = g_markup_escape_text(extra_msg, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1715 tmp = g_strdup_printf(_("%s [<I>%s</I>] entered the room."),
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1716 alias_esc, extra_msg_esc);
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1717 g_free(extra_msg_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1718 }
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1719 g_free(alias_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1720
18026
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1721 purple_conversation_write(conv, NULL, tmp,
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1722 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY,
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1723 time(NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1724 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1725 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1726
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1727 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1728 "chat-buddy-joined", conv, user, flag, new_arrivals);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1729 ul = ul->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1730 fl = fl->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1731 if (extra_msgs != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1732 extra_msgs = extra_msgs->next;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1733 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1734
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1735 cbuddies = g_list_sort(cbuddies, (GCompareFunc)purple_conv_chat_cb_compare);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1736
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1737 if (ops != NULL && ops->chat_add_users != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1738 ops->chat_add_users(conv, cbuddies, new_arrivals);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1739
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1740 g_list_free(cbuddies);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1741 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1742
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1743 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1744 purple_conv_chat_rename_user(PurpleConvChat *chat, const char *old_user,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1745 const char *new_user)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1746 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1747 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1748 PurpleConversationUiOps *ops;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1749 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1750 PurplePluginProtocolInfo *prpl_info;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1751 PurpleConvChatBuddy *cb;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1752 PurpleConvChatBuddyFlags flags;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1753 const char *new_alias = new_user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1754 char tmp[BUF_LONG];
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1755 gboolean is_me = FALSE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1756
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1757 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1758 g_return_if_fail(old_user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1759 g_return_if_fail(new_user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1760
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1761 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1762 ops = purple_conversation_get_ui_ops(conv);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1763
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1764 gc = purple_conversation_get_gc(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1765 g_return_if_fail(gc != NULL);
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22029
diff changeset
1766 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1767 g_return_if_fail(prpl_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1768
25385
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 25299
diff changeset
1769 if (purple_strequal(chat->nick, purple_normalize(conv->account, old_user))) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1770 const char *alias;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1771
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1772 /* Note this for later. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1773 is_me = TRUE;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1774
17709
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1775 if(!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1776 alias = purple_account_get_alias(conv->account);
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1777 if (alias != NULL)
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1778 new_alias = alias;
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1779 else
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1780 {
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1781 const char *display_name = purple_connection_get_display_name(gc);
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1782 if (display_name != NULL)
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1783 alias = display_name;
4b18cc7b6177 don't show your own alias (half the time) when in a chatroom where no one
Nathan Walp <nwalp@pidgin.im>
parents: 17657
diff changeset
1784 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1785 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1786 } else if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1787 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1788 if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1789 new_alias = purple_buddy_get_contact_alias(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1790 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1791
18305
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
1792 flags = purple_conv_chat_user_get_flags(chat, old_user);
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
1793 cb = purple_conv_chat_cb_new(new_user, new_alias, flags);
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
1794 cb->buddy = purple_find_buddy(conv->account, new_user) != NULL;
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1795
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1796 chat->in_room = g_list_prepend(chat->in_room, cb);
32170
f7c3aac5b22b conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <paul@darkrain42.org>
parents: 32168
diff changeset
1797 g_hash_table_replace(chat->users, g_strdup(cb->name), cb);
18305
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
1798
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1799 if (ops != NULL && ops->chat_rename_user != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1800 ops->chat_rename_user(conv, old_user, new_user, new_alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1801
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1802 cb = purple_conv_chat_cb_find(chat, old_user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1803
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1804 if (cb) {
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1805 chat->in_room = g_list_remove(chat->in_room, cb);
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1806 g_hash_table_remove(chat->users, cb->name);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1807 purple_conv_chat_cb_destroy(cb);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1808 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1809
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1810 if (purple_conv_chat_is_user_ignored(chat, old_user)) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1811 purple_conv_chat_unignore(chat, old_user);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1812 purple_conv_chat_ignore(chat, new_user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1813 }
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1814 else if (purple_conv_chat_is_user_ignored(chat, new_user))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1815 purple_conv_chat_unignore(chat, new_user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1816
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1817 if (is_me)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1818 purple_conv_chat_set_nick(chat, new_user);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1819
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
1820 if (purple_prefs_get_bool("/purple/conversations/chat/show_nick_change") &&
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1821 !purple_conv_chat_is_user_ignored(chat, new_user)) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1822
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1823 if (is_me) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1824 char *escaped = g_markup_escape_text(new_user, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1825 g_snprintf(tmp, sizeof(tmp),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1826 _("You are now known as %s"), escaped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1827 g_free(escaped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1828 } else {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1829 const char *old_alias = old_user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1830 const char *new_alias = new_user;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1831 char *escaped;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1832 char *escaped2;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1833
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1834 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1835 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1836
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1837 if ((buddy = purple_find_buddy(gc->account, old_user)) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1838 old_alias = purple_buddy_get_contact_alias(buddy);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1839 if ((buddy = purple_find_buddy(gc->account, new_user)) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1840 new_alias = purple_buddy_get_contact_alias(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1841 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1842
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1843 escaped = g_markup_escape_text(old_alias, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1844 escaped2 = g_markup_escape_text(new_alias, -1);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1845 g_snprintf(tmp, sizeof(tmp),
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1846 _("%s is now known as %s"), escaped, escaped2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1847 g_free(escaped);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1848 g_free(escaped2);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1849 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1850
18028
2754427b85ca missed these last time
Nathan Walp <nwalp@pidgin.im>
parents: 18026
diff changeset
1851 purple_conversation_write(conv, NULL, tmp,
2754427b85ca missed these last time
Nathan Walp <nwalp@pidgin.im>
parents: 18026
diff changeset
1852 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY,
2754427b85ca missed these last time
Nathan Walp <nwalp@pidgin.im>
parents: 18026
diff changeset
1853 time(NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1854 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1855 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1856
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1857 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1858 purple_conv_chat_remove_user(PurpleConvChat *chat, const char *user, const char *reason)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1859 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1860 GList *users = g_list_append(NULL, (char *)user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1861
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1862 purple_conv_chat_remove_users(chat, users, reason);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1863
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1864 g_list_free(users);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1865 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1866
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1867 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1868 purple_conv_chat_remove_users(PurpleConvChat *chat, GList *users, const char *reason)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1869 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1870 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1871 PurpleConnection *gc;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1872 PurplePluginProtocolInfo *prpl_info;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1873 PurpleConversationUiOps *ops;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1874 PurpleConvChatBuddy *cb;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1875 GList *l;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1876 gboolean quiet;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1877
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1878 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1879 g_return_if_fail(users != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1880
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1881 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1882
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1883 gc = purple_conversation_get_gc(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1884 g_return_if_fail(gc != NULL);
22262
edca47ee06c5 Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22029
diff changeset
1885 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1886 g_return_if_fail(prpl_info != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1887
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1888 ops = purple_conversation_get_ui_ops(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1889
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1890 for (l = users; l != NULL; l = l->next) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1891 const char *user = (const char *)l->data;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1892 quiet = GPOINTER_TO_INT(purple_signal_emit_return_1(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1893 "chat-buddy-leaving", conv, user, reason)) |
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1894 purple_conv_chat_is_user_ignored(chat, user);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1895
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1896 cb = purple_conv_chat_cb_find(chat, user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1897
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1898 if (cb) {
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1899 chat->in_room = g_list_remove(chat->in_room, cb);
32173
dc69d22279e5 conversation: Okay, one final fix.
Paul Aurich <paul@darkrain42.org>
parents: 32171
diff changeset
1900 g_hash_table_remove(chat->users, cb->name);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1901 purple_conv_chat_cb_destroy(cb);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1902 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1903
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1904 /* NOTE: Don't remove them from ignored in case they re-enter. */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1905
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1906 if (!quiet) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1907 const char *alias = user;
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1908 char *alias_esc;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1909 char *tmp;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1910
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1911 if (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1912 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1913
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1914 if ((buddy = purple_find_buddy(gc->account, user)) != NULL)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1915 alias = purple_buddy_get_contact_alias(buddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1916 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1917
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1918 alias_esc = g_markup_escape_text(alias, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1919
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1920 if (reason == NULL || !*reason)
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1921 tmp = g_strdup_printf(_("%s left the room."), alias_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1922 else {
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1923 char *reason_esc = g_markup_escape_text(reason, -1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1924 tmp = g_strdup_printf(_("%s left the room (%s)."),
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1925 alias_esc, reason_esc);
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1926 g_free(reason_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1927 }
23418
0b6475f97648 Give some variables holding escaped versions of other strings more meaningful names.
Will Thompson <will.thompson@collabora.co.uk>
parents: 23417
diff changeset
1928 g_free(alias_esc);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1929
18026
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1930 purple_conversation_write(conv, NULL, tmp,
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1931 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY,
c3d03dd25434 use the new NO_LINKIFY flag for join and part messages
Nathan Walp <nwalp@pidgin.im>
parents: 18025
diff changeset
1932 time(NULL));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1933 g_free(tmp);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1934 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1935
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1936 purple_signal_emit(purple_conversations_get_handle(), "chat-buddy-left",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1937 conv, user, reason);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1938 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1939
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1940 if (ops != NULL && ops->chat_remove_users != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1941 ops->chat_remove_users(conv, users);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1942 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1943
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1944 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1945 purple_conv_chat_clear_users(PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1946 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1947 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1948 PurpleConversationUiOps *ops;
18115
871d9aa8e51c Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e:
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1949 GList *users;
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
1950 GList *l;
18115
871d9aa8e51c Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e:
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1951 GList *names = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1952
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1953 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1954
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1955 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1956 ops = purple_conversation_get_ui_ops(conv);
18115
871d9aa8e51c Re-apply a good change from 1411afd7660760db59966c3a9f18e2adab8eb27e:
Richard Laager <rlaager@wiktel.com>
parents: 18063
diff changeset
1957 users = chat->in_room;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1958
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1959 if (ops != NULL && ops->chat_remove_users != NULL) {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1960 for (l = users; l; l = l->next) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1961 PurpleConvChatBuddy *cb = l->data;
17753
25d808baa395 In purple_conv_chat_clear_users(), use g_list_prepend() instead of
Richard Laager <rlaager@wiktel.com>
parents: 17709
diff changeset
1962 names = g_list_prepend(names, cb->name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1963 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1964 ops->chat_remove_users(conv, names);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1965 g_list_free(names);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1966 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1967
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1968 for (l = users; l; l = l->next)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1969 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1970 PurpleConvChatBuddy *cb = l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1971
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1972 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1973 "chat-buddy-leaving", conv, cb->name, NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1974 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1975 "chat-buddy-left", conv, cb->name, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1976
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1977 purple_conv_chat_cb_destroy(cb);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1978 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1979
32170
f7c3aac5b22b conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <paul@darkrain42.org>
parents: 32168
diff changeset
1980 g_hash_table_remove_all(chat->users);
f7c3aac5b22b conversation: Use a copy of the name and clear hash after emitting "left" signals
Paul Aurich <paul@darkrain42.org>
parents: 32168
diff changeset
1981
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1982 g_list_free(users);
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
1983 chat->in_room = NULL;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1984 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1985
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1986
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1987 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1988 purple_conv_chat_find_user(PurpleConvChat *chat, const char *user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1989 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1990 g_return_val_if_fail(chat != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1991 g_return_val_if_fail(user != NULL, FALSE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1992
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1993 return (purple_conv_chat_cb_find(chat, user) != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1994 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1995
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1996 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1997 purple_conv_chat_user_set_flags(PurpleConvChat *chat, const char *user,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
1998 PurpleConvChatBuddyFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1999 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2000 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2001 PurpleConversationUiOps *ops;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2002 PurpleConvChatBuddy *cb;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2003 PurpleConvChatBuddyFlags oldflags;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2004
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2005 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2006 g_return_if_fail(user != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2007
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2008 cb = purple_conv_chat_cb_find(chat, user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2009
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2010 if (!cb)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2011 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2012
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2013 if (flags == cb->flags)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2014 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2015
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2016 oldflags = cb->flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2017 cb->flags = flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2018
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2019 conv = purple_conv_chat_get_conversation(chat);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2020 ops = purple_conversation_get_ui_ops(conv);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2021
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2022 if (ops != NULL && ops->chat_update_user != NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2023 ops->chat_update_user(conv, user);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2024
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2025 purple_signal_emit(purple_conversations_get_handle(),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2026 "chat-buddy-flags", conv, user, oldflags, flags);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2027 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2028
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2029 PurpleConvChatBuddyFlags
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2030 purple_conv_chat_user_get_flags(PurpleConvChat *chat, const char *user)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2031 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2032 PurpleConvChatBuddy *cb;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2033
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2034 g_return_val_if_fail(chat != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2035 g_return_val_if_fail(user != NULL, 0);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2036
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2037 cb = purple_conv_chat_cb_find(chat, user);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2038
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2039 if (!cb)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2040 return PURPLE_CBFLAGS_NONE;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2041
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2042 return cb->flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2043 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2044
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2045 void purple_conv_chat_set_nick(PurpleConvChat *chat, const char *nick) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2046 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2047
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2048 g_free(chat->nick);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2049 chat->nick = g_strdup(purple_normalize(chat->conv->account, nick));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2050 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2051
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2052 const char *purple_conv_chat_get_nick(PurpleConvChat *chat) {
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2053 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2054
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2055 return chat->nick;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2056 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2057
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2058 PurpleConversation *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2059 purple_find_chat(const PurpleConnection *gc, int id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2060 {
18063
926ccb104da0 disapproval of revision '1411afd7660760db59966c3a9f18e2adab8eb27e'
Richard Laager <rlaager@wiktel.com>
parents: 18058
diff changeset
2061 GList *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2062 PurpleConversation *conv;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2063
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2064 for (l = purple_get_chats(); l != NULL; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2065 conv = (PurpleConversation *)l->data;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2066
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2067 if (purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv)) == id &&
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2068 purple_conversation_get_gc(conv) == gc)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2069 return conv;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2070 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2071
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2072 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2073 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2074
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2075 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2076 purple_conv_chat_left(PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2077 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2078 g_return_if_fail(chat != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2079
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2080 chat->left = TRUE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2081 purple_conversation_update(chat->conv, PURPLE_CONV_UPDATE_CHATLEFT);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2082 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2083
26623
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2084 static void
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2085 invite_user_to_chat(gpointer data, PurpleRequestFields *fields)
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2086 {
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2087 PurpleConversation *conv;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2088 PurpleConvChat *chat;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2089 const char *user, *message;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2090
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2091 conv = data;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2092 chat = PURPLE_CONV_CHAT(conv);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2093 user = purple_request_fields_get_string(fields, "screenname");
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2094 message = purple_request_fields_get_string(fields, "message");
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2095
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2096 serv_chat_invite(purple_conversation_get_gc(conv), chat->id, message, user);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2097 }
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2098
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2099 void purple_conv_chat_invite_user(PurpleConvChat *chat, const char *user,
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2100 const char *message, gboolean confirm)
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2101 {
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2102 PurpleAccount *account;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2103 PurpleConversation *conv;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2104 PurpleRequestFields *fields;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2105 PurpleRequestFieldGroup *group;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2106 PurpleRequestField *field;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2107
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2108 g_return_if_fail(chat);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2109
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2110 if (!user || !*user || !message || !*message)
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2111 confirm = TRUE;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2112
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2113 conv = chat->conv;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2114 account = conv->account;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2115
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2116 if (!confirm) {
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2117 serv_chat_invite(purple_account_get_connection(account),
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2118 purple_conv_chat_get_id(chat), message, user);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2119 return;
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2120 }
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2121
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2122 fields = purple_request_fields_new();
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2123 group = purple_request_field_group_new(_("Invite to chat"));
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2124 purple_request_fields_add_group(fields, group);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2125
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2126 field = purple_request_field_string_new("screenname", _("Buddy"), user, FALSE);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2127 purple_request_field_group_add_field(group, field);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2128 purple_request_field_set_required(field, TRUE);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2129 purple_request_field_set_type_hint(field, "screenname");
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2130
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2131 field = purple_request_field_string_new("message", _("Message"), message, FALSE);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2132 purple_request_field_group_add_field(group, field);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2133
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2134 purple_request_fields(conv, _("Invite to chat"), NULL,
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2135 _("Please enter the name of the user you wish to invite, "
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2136 "along with an optional invite message."),
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2137 fields,
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2138 _("Invite"), G_CALLBACK(invite_user_to_chat),
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2139 _("Cancel"), NULL,
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2140 account, user, conv,
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2141 conv);
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2142 }
15ae2dea92b3 Open a chat-invite dialog when a buddy is dragged onto a chat.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 26612
diff changeset
2143
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2144 gboolean
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2145 purple_conv_chat_has_left(PurpleConvChat *chat)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2146 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2147 g_return_val_if_fail(chat != NULL, TRUE);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2148
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2149 return chat->left;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2150 }
18305
ffd706ec0220 Set and use convchatbuddy->buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18121
diff changeset
2151
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2152 PurpleConvChatBuddy *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2153 purple_conv_chat_cb_new(const char *name, const char *alias, PurpleConvChatBuddyFlags flags)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2154 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2155 PurpleConvChatBuddy *cb;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2156
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2157 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2158
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2159 cb = g_new0(PurpleConvChatBuddy, 1);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2160 cb->name = g_strdup(name);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2161 cb->flags = flags;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2162 cb->alias = g_strdup(alias);
31822
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2163 cb->attributes = g_hash_table_new_full(g_str_hash, g_str_equal,
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2164 g_free, g_free);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2165
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2166 PURPLE_DBUS_REGISTER_POINTER(cb, PurpleConvChatBuddy);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2167 return cb;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2168 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2169
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2170 PurpleConvChatBuddy *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2171 purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2172 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2173 g_return_val_if_fail(chat != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2174 g_return_val_if_fail(name != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2175
32165
47f7b8ca6149 conversation: O(1) purple_conv_chat_cb_find
Paul Aurich <paul@darkrain42.org>
parents: 31894
diff changeset
2176 return g_hash_table_lookup(chat->users, name);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2177 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2178
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2179 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2180 purple_conv_chat_cb_destroy(PurpleConvChatBuddy *cb)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2181 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2182 if (cb == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2183 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2184
32171
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2185 purple_signal_emit(purple_conversations_get_handle(),
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2186 "deleting-chat-buddy", cb);
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2187
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2188 g_free(cb->alias);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2189 g_free(cb->alias_key);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2190 g_free(cb->name);
31822
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2191 g_hash_table_destroy(cb->attributes);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2192
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2193 PURPLE_DBUS_UNREGISTER_POINTER(cb);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2194 g_free(cb);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2195 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2196
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2197 const char *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2198 purple_conv_chat_cb_get_name(PurpleConvChatBuddy *cb)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2199 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2200 g_return_val_if_fail(cb != NULL, NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2201
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2202 return cb->name;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2203 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2204
31822
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2205 const char *
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2206 purple_conv_chat_cb_get_attribute(PurpleConvChatBuddy *cb, const char *key)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2207 {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2208 g_return_val_if_fail(cb != NULL, NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2209 g_return_val_if_fail(key != NULL, NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2210
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2211 return g_hash_table_lookup(cb->attributes, key);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2212 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2213
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2214 static void
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2215 append_attribute_key(gpointer key, gpointer value, gpointer user_data)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2216 {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2217 GList **list = user_data;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2218 *list = g_list_prepend(*list, key);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2219 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2220
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2221 GList *
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2222 purple_conv_chat_cb_get_attribute_keys(PurpleConvChatBuddy *cb)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2223 {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2224 GList *keys = NULL;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2225
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2226 g_return_val_if_fail(cb != NULL, NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2227
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2228 g_hash_table_foreach(cb->attributes, (GHFunc)append_attribute_key, &keys);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2229
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2230 return keys;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2231 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2232
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2233 void
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2234 purple_conv_chat_cb_set_attribute(PurpleConvChat *chat, PurpleConvChatBuddy *cb, const char *key, const char *value)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2235 {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2236 PurpleConversation *conv;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2237 PurpleConversationUiOps *ops;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2238
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2239 g_return_if_fail(cb != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2240 g_return_if_fail(key != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2241 g_return_if_fail(value != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2242
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2243 g_hash_table_replace(cb->attributes, g_strdup(key), g_strdup(value));
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2244
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2245 conv = purple_conv_chat_get_conversation(chat);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2246 ops = purple_conversation_get_ui_ops(conv);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2247
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2248 if (ops != NULL && ops->chat_update_user != NULL)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2249 ops->chat_update_user(conv, cb->name);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2250 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2251
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2252 void
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2253 purple_conv_chat_cb_set_attributes(PurpleConvChat *chat, PurpleConvChatBuddy *cb, GList *keys, GList *values)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2254 {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2255 PurpleConversation *conv;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2256 PurpleConversationUiOps *ops;
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2257
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2258 g_return_if_fail(cb != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2259 g_return_if_fail(keys != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2260 g_return_if_fail(values != NULL);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2261
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2262 while (keys != NULL && values != NULL) {
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2263 g_hash_table_replace(cb->attributes, g_strdup(keys->data), g_strdup(values->data));
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2264 keys = g_list_next(keys);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2265 values = g_list_next(values);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2266 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2267
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2268 conv = purple_conv_chat_get_conversation(chat);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2269 ops = purple_conversation_get_ui_ops(conv);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2270
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2271 if (ops != NULL && ops->chat_update_user != NULL)
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2272 ops->chat_update_user(conv, cb->name);
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2273 }
6c660dc7cb6a Moved the conversation attributes API and the IRC periodic WHO updates to i.p.p.next.minor, where they belong.
Evan Schoenberg <evan.s@dreskin.net>
parents: 31534
diff changeset
2274
17220
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2275 GList *
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2276 purple_conversation_get_extended_menu(PurpleConversation *conv)
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2277 {
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2278 GList *menu = NULL;
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2279
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2280 g_return_val_if_fail(conv != NULL, NULL);
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2281
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2282 purple_signal_emit(purple_conversations_get_handle(),
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2283 "conversation-extended-menu", conv, &menu);
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2284 return menu;
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2285 }
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2286
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2287 void purple_conversation_clear_message_history(PurpleConversation *conv)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2288 {
19705
7ea794e7cec3 Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
2289 GList *list = conv->message_history;
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2290 message_history_free(list);
19705
7ea794e7cec3 Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
2291 conv->message_history = NULL;
31894
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2292
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2293 purple_signal_emit(purple_conversations_get_handle(),
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2294 "cleared-message-history", conv);
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2295 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2296
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2297 GList *purple_conversation_get_message_history(PurpleConversation *conv)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2298 {
19705
7ea794e7cec3 Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
2299 return conv->message_history;
19413
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2300 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2301
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2302 const char *purple_conversation_message_get_sender(PurpleConvMessage *msg)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2303 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2304 g_return_val_if_fail(msg, NULL);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2305 return msg->who;
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2306 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2307
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2308 const char *purple_conversation_message_get_message(PurpleConvMessage *msg)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2309 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2310 g_return_val_if_fail(msg, NULL);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2311 return msg->what;
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2312 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2313
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2314 PurpleMessageFlags purple_conversation_message_get_flags(PurpleConvMessage *msg)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2315 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2316 g_return_val_if_fail(msg, 0);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2317 return msg->flags;
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2318 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2319
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2320 time_t purple_conversation_message_get_timestamp(PurpleConvMessage *msg)
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2321 {
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2322 g_return_val_if_fail(msg, 0);
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2323 return msg->when;
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2324 }
deb9471d7142 Store message history in a conversation, and provide API to access the history.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18823
diff changeset
2325
32431
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2326 void purple_conversation_set_ui_data(PurpleConversation *conv, gpointer ui_data)
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2327 {
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2328 g_return_if_fail(conv != NULL);
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2329
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2330 conv->ui_data = ui_data;
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2331 }
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2332
32434
e5e81ce9c564 These pointers should rather be marked const.
andrew.victor@mxit.com
parents: 32431
diff changeset
2333 gpointer purple_conversation_get_ui_data(const PurpleConversation *conv)
32431
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2334 {
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2335 g_return_val_if_fail(conv != NULL, NULL);
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2336
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2337 return conv->ui_data;
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2338 }
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2339
c0a423e7fea4 Add accessor functions purple_conversation_get_ui_data() and purple_conversation_set_ui_data().
andrew.victor@mxit.com
parents: 32180
diff changeset
2340
17221
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2341 gboolean
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2342 purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline,
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2343 const gchar *markup, gchar **error)
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2344 {
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2345 char *mark = (markup && *markup) ? NULL : g_markup_escape_text(cmdline, -1), *err = NULL;
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2346 PurpleCmdStatus status = purple_cmd_do_command(conv, cmdline, mark ? mark : markup, error ? error : &err);
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2347 g_free(mark);
17222
192be492ce25 Plug a possible memory leak.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17221
diff changeset
2348 g_free(err);
17221
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2349 return (status == PURPLE_CMD_STATUS_OK);
c9a046a7f326 New function purple_conversation_do_command. This is almost like
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17220
diff changeset
2350 }
17220
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2351
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2352 void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2353 purple_conversations_get_handle(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2354 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2355 static int handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2356
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2357 return &handle;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2358 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2359
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2360 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2361 purple_conversations_init(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2362 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2363 void *handle = purple_conversations_get_handle();
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2364
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
2365 conversation_cache = g_hash_table_new_full((GHashFunc)_purple_conversations_hconv_hash,
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
2366 (GEqualFunc)_purple_conversations_hconv_equal,
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
2367 (GDestroyNotify)_purple_conversations_hconv_free_key, NULL);
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
2368
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2369 /**********************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2370 * Register preferences
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2371 **********************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2372
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2373 /* Conversations */
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2374 purple_prefs_add_none("/purple/conversations");
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2375
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2376 /* Conversations -> Chat */
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2377 purple_prefs_add_none("/purple/conversations/chat");
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2378 purple_prefs_add_bool("/purple/conversations/chat/show_nick_change", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2379
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2380 /* Conversations -> IM */
16427
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2381 purple_prefs_add_none("/purple/conversations/im");
4999bbc52881 Works for me! Renames prefs: /core to /purple, /gaim/gtk to /pidgin, /gaim/gnt to /finch
Sean Egan <seanegan@gmail.com>
parents: 15823
diff changeset
2382 purple_prefs_add_bool("/purple/conversations/im/send_typing", TRUE);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2383
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2384
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2385 /**********************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2386 * Register signals
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2387 **********************************************************************/
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2388 purple_signal_register(handle, "writing-im-msg",
18496
f4d05584369e Fix up writing-im-msg and writing-chat-msg to use a marshaller which treats the
Will Thompson <will.thompson@collabora.co.uk>
parents: 18305
diff changeset
2389 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2390 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2391 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2392 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2393 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2394 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2395 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2396 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2397 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2398
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2399 purple_signal_register(handle, "wrote-im-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2400 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2401 NULL, 5,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2402 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2403 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2404 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2405 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2406 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2407 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2408 purple_value_new(PURPLE_TYPE_UINT));
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 30863
diff changeset
2409
29638
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2410 purple_signal_register(handle, "sent-attention",
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2411 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2412 NULL, 4,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2413 purple_value_new(PURPLE_TYPE_SUBTYPE,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2414 PURPLE_SUBTYPE_ACCOUNT),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2415 purple_value_new(PURPLE_TYPE_STRING),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2416 purple_value_new(PURPLE_TYPE_SUBTYPE,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2417 PURPLE_SUBTYPE_CONVERSATION),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2418 purple_value_new(PURPLE_TYPE_UINT));
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 30863
diff changeset
2419
29638
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2420 purple_signal_register(handle, "got-attention",
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2421 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2422 NULL, 4,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2423 purple_value_new(PURPLE_TYPE_SUBTYPE,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2424 PURPLE_SUBTYPE_ACCOUNT),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2425 purple_value_new(PURPLE_TYPE_STRING),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2426 purple_value_new(PURPLE_TYPE_SUBTYPE,
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2427 PURPLE_SUBTYPE_CONVERSATION),
22b8a92fb5ee Adds attention UI to Pidgin (can send attentions using a menu item)
Marcus Lundblad <ml@update.uu.se>
parents: 23782
diff changeset
2428 purple_value_new(PURPLE_TYPE_UINT));
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 30863
diff changeset
2429
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2430 purple_signal_register(handle, "sending-im-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2431 purple_marshal_VOID__POINTER_POINTER_POINTER,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2432 NULL, 3,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2433 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2434 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2435 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2436 purple_value_new_outgoing(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2437
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2438 purple_signal_register(handle, "sent-im-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2439 purple_marshal_VOID__POINTER_POINTER_POINTER,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2440 NULL, 3,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2441 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2442 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2443 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2444 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2445
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2446 purple_signal_register(handle, "receiving-im-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2447 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2448 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2449 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2450 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2451 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2452 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2453 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2454 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2455 purple_value_new_outgoing(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2456
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2457 purple_signal_register(handle, "received-im-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2458 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2459 NULL, 5,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2460 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2461 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2462 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2463 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2464 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2465 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2466 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2467
23171
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2468 purple_signal_register(handle, "blocked-im-msg",
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2469 purple_marshal_VOID__POINTER_POINTER_POINTER_UINT_UINT,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2470 NULL, 5,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2471 purple_value_new(PURPLE_TYPE_SUBTYPE,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2472 PURPLE_SUBTYPE_ACCOUNT),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2473 purple_value_new(PURPLE_TYPE_STRING),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2474 purple_value_new(PURPLE_TYPE_STRING),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2475 purple_value_new(PURPLE_TYPE_UINT),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2476 purple_value_new(PURPLE_TYPE_UINT));
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2477
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2478 purple_signal_register(handle, "writing-chat-msg",
18496
f4d05584369e Fix up writing-im-msg and writing-chat-msg to use a marshaller which treats the
Will Thompson <will.thompson@collabora.co.uk>
parents: 18305
diff changeset
2479 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_UINT,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2480 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2481 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2482 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2483 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2484 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2485 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2486 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2487 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2488
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2489 purple_signal_register(handle, "wrote-chat-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2490 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2491 NULL, 5,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2492 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2493 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2494 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2495 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2496 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2497 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2498 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2499
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2500 purple_signal_register(handle, "sending-chat-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2501 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2502 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2503 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2504 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2505 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2506
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2507 purple_signal_register(handle, "sent-chat-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2508 purple_marshal_VOID__POINTER_POINTER_UINT, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2509 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2510 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2511 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2512 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2513
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2514 purple_signal_register(handle, "receiving-chat-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2515 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2516 purple_value_new(PURPLE_TYPE_BOOLEAN), 5,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2517 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2518 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2519 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2520 purple_value_new_outgoing(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2521 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2522 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2523 purple_value_new_outgoing(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2524
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2525 purple_signal_register(handle, "received-chat-msg",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2526 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_UINT,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2527 NULL, 5,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2528 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2529 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2530 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2531 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2532 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2533 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2534 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2535
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2536 purple_signal_register(handle, "conversation-created",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2537 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2538 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2539 PURPLE_SUBTYPE_CONVERSATION));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2540
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2541 purple_signal_register(handle, "conversation-updated",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2542 purple_marshal_VOID__POINTER_UINT, NULL, 2,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2543 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2544 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2545 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2546
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2547 purple_signal_register(handle, "deleting-conversation",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2548 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2549 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2550 PURPLE_SUBTYPE_CONVERSATION));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2551
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2552 purple_signal_register(handle, "buddy-typing",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2553 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2554 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2555 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2556 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2557
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2558 purple_signal_register(handle, "buddy-typed",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2559 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2560 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2561 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2562 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2563
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2564 purple_signal_register(handle, "buddy-typing-stopped",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2565 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2566 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2567 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2568 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2569
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2570 purple_signal_register(handle, "chat-buddy-joining",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2571 purple_marshal_BOOLEAN__POINTER_POINTER_UINT,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2572 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2573 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2574 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2575 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2576 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2577
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2578 purple_signal_register(handle, "chat-buddy-joined",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2579 purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2580 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2581 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2582 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2583 purple_value_new(PURPLE_TYPE_UINT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2584 purple_value_new(PURPLE_TYPE_BOOLEAN));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2585
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2586 purple_signal_register(handle, "chat-buddy-flags",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2587 purple_marshal_VOID__POINTER_POINTER_UINT_UINT, NULL, 4,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2588 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2589 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2590 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2591 purple_value_new(PURPLE_TYPE_UINT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2592 purple_value_new(PURPLE_TYPE_UINT));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2593
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2594 purple_signal_register(handle, "chat-buddy-leaving",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2595 purple_marshal_BOOLEAN__POINTER_POINTER_POINTER,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2596 purple_value_new(PURPLE_TYPE_BOOLEAN), 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2597 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2598 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2599 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2600 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2601
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2602 purple_signal_register(handle, "chat-buddy-left",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2603 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2604 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2605 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2606 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2607 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2608
32171
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2609 purple_signal_register(handle, "deleting-chat-buddy",
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2610 purple_marshal_VOID__POINTER, NULL, 1,
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2611 purple_value_new(PURPLE_TYPE_SUBTYPE,
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2612 PURPLE_SUBTYPE_CHATBUDDY));
298685661f89 Add constant-time lookup of row in the userlist by way of PurpleConvChatBuddy ui_data
Paul Aurich <paul@darkrain42.org>
parents: 32170
diff changeset
2613
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2614 purple_signal_register(handle, "chat-inviting-user",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2615 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2616 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2617 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2618 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2619 purple_value_new_outgoing(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2620
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2621 purple_signal_register(handle, "chat-invited-user",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2622 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2623 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2624 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2625 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2626 purple_value_new(PURPLE_TYPE_STRING));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2627
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2628 purple_signal_register(handle, "chat-invited",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2629 purple_marshal_INT__POINTER_POINTER_POINTER_POINTER_POINTER,
20174
eb758ca32ea9 chat-invited handlers return an interger value.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19705
diff changeset
2630 purple_value_new(PURPLE_TYPE_INT), 5,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2631 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2632 PURPLE_SUBTYPE_ACCOUNT),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2633 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2634 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2635 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2636 purple_value_new(PURPLE_TYPE_POINTER));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2637
23171
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2638 purple_signal_register(handle, "chat-invite-blocked",
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2639 purple_marshal_VOID__POINTER_POINTER_POINTER_POINTER_POINTER,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2640 NULL, 5,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2641 purple_value_new(PURPLE_TYPE_SUBTYPE,
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2642 PURPLE_SUBTYPE_ACCOUNT),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2643 purple_value_new(PURPLE_TYPE_STRING),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2644 purple_value_new(PURPLE_TYPE_STRING),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2645 purple_value_new(PURPLE_TYPE_STRING),
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2646 purple_value_new(PURPLE_TYPE_BOXED, "GHashTable *"));
ff8ec3d58367 Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 23113
diff changeset
2647
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2648 purple_signal_register(handle, "chat-joined",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2649 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2650 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2651 PURPLE_SUBTYPE_CONVERSATION));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2652
22891
43233dc1d40b applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents: 22740
diff changeset
2653 purple_signal_register(handle, "chat-join-failed",
43233dc1d40b applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents: 22740
diff changeset
2654 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
43233dc1d40b applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents: 22740
diff changeset
2655 purple_value_new(PURPLE_TYPE_SUBTYPE,
43233dc1d40b applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents: 22740
diff changeset
2656 PURPLE_SUBTYPE_CONNECTION),
23105
591ef3693345 As discussed on the devel list, purple_serv_got_join_chat_failed() and the
Evan Schoenberg <evan.s@dreskin.net>
parents: 22891
diff changeset
2657 purple_value_new(PURPLE_TYPE_POINTER));
22891
43233dc1d40b applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents: 22740
diff changeset
2658
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2659 purple_signal_register(handle, "chat-left",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2660 purple_marshal_VOID__POINTER, NULL, 1,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2661 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2662 PURPLE_SUBTYPE_CONVERSATION));
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2663
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2664 purple_signal_register(handle, "chat-topic-changed",
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2665 purple_marshal_VOID__POINTER_POINTER_POINTER, NULL, 3,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2666 purple_value_new(PURPLE_TYPE_SUBTYPE,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2667 PURPLE_SUBTYPE_CONVERSATION),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2668 purple_value_new(PURPLE_TYPE_STRING),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2669 purple_value_new(PURPLE_TYPE_STRING));
17220
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2670
31894
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2671 purple_signal_register(handle, "cleared-message-history",
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2672 purple_marshal_VOID__POINTER, NULL, 1,
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2673 purple_value_new(PURPLE_TYPE_SUBTYPE,
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2674 PURPLE_SUBTYPE_CONVERSATION));
a9e077fb65e9 Add a cleared-message-history conversation signal, and use it in Pidgin and Finch
Paul Aurich <paul@darkrain42.org>
parents: 31854
diff changeset
2675
17220
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2676 purple_signal_register(handle, "conversation-extended-menu",
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2677 purple_marshal_VOID__POINTER_POINTER, NULL, 2,
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2678 purple_value_new(PURPLE_TYPE_SUBTYPE,
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2679 PURPLE_SUBTYPE_CONVERSATION),
da2bab3b9fab New api function purple_conversation_get_extended_menu.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17095
diff changeset
2680 purple_value_new(PURPLE_TYPE_BOXED, "GList **"));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2681 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2682
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2683 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2684 purple_conversations_uninit(void)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2685 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2686 while (conversations)
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2687 purple_conversation_destroy((PurpleConversation*)conversations->data);
28033
ce3bc26aa8cd More efficient purple_find_conversation_with_account. Closes #9703.
aman@tmm1.net
parents: 28019
diff changeset
2688 g_hash_table_destroy(conversation_cache);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15374
diff changeset
2689 purple_signals_unregister_by_instance(purple_conversations_get_handle());
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2690 }
19705
7ea794e7cec3 Keep the message history in PurpleConversation.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19680
diff changeset
2691