Mercurial > pidgin.yaz
annotate libpurple/server.c @ 23292:106a912f1ef5
Make the IRC "unknown message" debugging messages UTF-8 safe.
Fixes #6019
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 05 Jun 2008 22:36:21 +0000 |
parents | ff8ec3d58367 |
children | 5e6392e93ce9 ff29208e03ef acef4202e147 |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15823 | 2 * purple |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15823 | 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:
19510
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 */ |
16753 | 23 |
24 /* This file is the fullcrap */ | |
25 | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "blist.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "conversation.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "log.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "privacy.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 #include "signals.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "server.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "status.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 #define SECS_BEFORE_RESENDING_AUTORESPONSE 600 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 #define SEX_BEFORE_RESENDING_AUTORESPONSE "Only after you're married" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 unsigned int |
15823 | 45 serv_send_typing(PurpleConnection *gc, const char *name, PurpleTypingState state) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
47 PurplePlugin *prpl = NULL; |
15823 | 48 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
50 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
51 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
53 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
54 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
55 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
56 if(prpl_info && prpl_info->send_typing) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 return prpl_info->send_typing(gc, name, state); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
58 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 return 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
60 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
61 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
62 static GSList *last_auto_responses = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 struct last_auto_response { |
15823 | 64 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
65 char name[80]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 time_t sent; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
67 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
68 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 static gboolean |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
70 expire_last_auto_responses(gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
72 GSList *tmp, *cur; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
73 struct last_auto_response *lar; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
74 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
75 tmp = last_auto_responses; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
76 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
77 while (tmp) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
78 cur = tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 tmp = tmp->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 lar = (struct last_auto_response *)cur->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
81 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
82 if ((time(NULL) - lar->sent) > SECS_BEFORE_RESENDING_AUTORESPONSE) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
83 last_auto_responses = g_slist_remove(last_auto_responses, lar); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 g_free(lar); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
86 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
87 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 return FALSE; /* do not run again */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
91 static struct last_auto_response * |
15823 | 92 get_last_auto_response(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
93 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 GSList *tmp; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 struct last_auto_response *lar; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
96 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
97 /* because we're modifying or creating a lar, schedule the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 * function to expire them as the pref dictates */ |
18006
f2d8658b3a86
merge of '62e9d17cd37551991c5040ce6ca48e6d7578dde3'
Richard Laager <rlaager@wiktel.com>
parents:
17071
diff
changeset
|
99 purple_timeout_add_seconds((SECS_BEFORE_RESENDING_AUTORESPONSE + 1), expire_last_auto_responses, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
100 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 tmp = last_auto_responses; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
102 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
103 while (tmp) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 lar = (struct last_auto_response *)tmp->data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 if (gc == lar->gc && !strncmp(name, lar->name, sizeof(lar->name))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
107 return lar; |
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 tmp = tmp->next; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 lar = (struct last_auto_response *)g_new0(struct last_auto_response, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 g_snprintf(lar->name, sizeof(lar->name), "%s", name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 lar->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 lar->sent = 0; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 last_auto_responses = g_slist_prepend(last_auto_responses, lar); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 return lar; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 |
15823 | 121 int serv_send_im(PurpleConnection *gc, const char *name, const char *message, |
122 PurpleMessageFlags flags) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
124 PurpleConversation *conv = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
125 PurpleAccount *account = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
126 PurplePresence *presence = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
127 PurplePlugin *prpl = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
128 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
129 int val = -EINVAL; |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
130 const gchar *auto_reply_pref = NULL; |
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 g_return_val_if_fail(gc != NULL, val); |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
133 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
134 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
136 g_return_val_if_fail(prpl != NULL, val); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
137 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
138 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
139 |
15823 | 140 account = purple_connection_get_account(gc); |
141 presence = purple_account_get_presence(account); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
143 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
145 if(prpl_info && prpl_info->send_im) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 val = prpl_info->send_im(gc, name, message, flags); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
147 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
149 * XXX - If "only auto-reply when away & idle" is set, then shouldn't |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 * this only reset lar->sent if we're away AND idle? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 */ |
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
|
152 auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply"); |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
153 if((gc->flags & PURPLE_CONNECTION_AUTO_RESP) && |
20063
669c152c0290
Only keep track of sent auto-responses in determining whether to send an auto-response. This will keep people who have had a conversation and then set themselves away from getting confused and thinking it doesn't work
Sean Egan <seanegan@gmail.com>
parents:
19716
diff
changeset
|
154 flags & PURPLE_MESSAGE_AUTO_RESP && |
15823 | 155 !purple_presence_is_available(presence) && |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
156 strcmp(auto_reply_pref, "never")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
158 struct last_auto_response *lar; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
159 lar = get_last_auto_response(gc, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 lar->sent = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
161 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
163 if(conv && purple_conv_im_get_send_typed_timeout(PURPLE_CONV_IM(conv))) |
15823 | 164 purple_conv_im_stop_send_typed_timeout(PURPLE_CONV_IM(conv)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
165 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
166 return val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
167 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
168 |
15823 | 169 void serv_get_info(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
171 PurplePlugin *prpl = NULL; |
15823 | 172 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
173 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
174 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
175 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
176 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
177 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
178 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
179 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
180 if(gc && prpl_info && prpl_info->get_info) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 prpl_info->get_info(gc, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
182 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
183 |
15823 | 184 void serv_set_info(PurpleConnection *gc, const char *info) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
185 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
186 PurplePlugin *prpl = NULL; |
15823 | 187 PurplePluginProtocolInfo *prpl_info = NULL; |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
188 PurpleAccount *account = NULL;; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
189 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
190 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
191 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
192 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
193 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
194 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
196 if(prpl_info && prpl_info->set_info) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
197 |
15823 | 198 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
199 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
200 if(purple_signal_emit_return_1(purple_accounts_get_handle(), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
201 "account-setting-info", account, info)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
202 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
203 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
204 prpl_info->set_info(gc, info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
205 |
15823 | 206 purple_signal_emit(purple_accounts_get_handle(), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
207 "account-set-info", account, info); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
208 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
209 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
210 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
212 * Set buddy's alias on server roster/list |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
213 */ |
15823 | 214 void serv_alias_buddy(PurpleBuddy *b) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
215 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
216 PurpleAccount *account = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
217 PurpleConnection *gc = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
218 PurplePlugin *prpl = NULL; |
15823 | 219 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
221 if(b) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
222 account = purple_buddy_get_account(b); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
223 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
224 if(account) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
225 gc = purple_account_get_connection(account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
227 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
228 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
229 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
230 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
231 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
232 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
233 if(b && prpl_info && prpl_info->alias_buddy) { |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
234 prpl_info->alias_buddy(gc, b->name, b->alias); |
15374
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 void |
15823 | 239 serv_got_alias(PurpleConnection *gc, const char *who, const char *alias) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
241 PurpleAccount *account; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
242 GSList *buddies; |
15823 | 243 PurpleBuddy *b; |
244 PurpleConversation *conv; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
246 account = purple_connection_get_account(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
247 buddies = purple_find_buddies(account, who); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
248 |
16817
10f175539cfe
Change a few functions to free a linked list while iterating through
Mark Doliner <mark@kingant.net>
parents:
16753
diff
changeset
|
249 while (buddies != NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 { |
16817
10f175539cfe
Change a few functions to free a linked list while iterating through
Mark Doliner <mark@kingant.net>
parents:
16753
diff
changeset
|
251 b = buddies->data; |
10f175539cfe
Change a few functions to free a linked list while iterating through
Mark Doliner <mark@kingant.net>
parents:
16753
diff
changeset
|
252 buddies = g_slist_delete_link(buddies, buddies); |
10f175539cfe
Change a few functions to free a linked list while iterating through
Mark Doliner <mark@kingant.net>
parents:
16753
diff
changeset
|
253 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
254 if((b->server_alias == NULL && alias == NULL) || |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 (b->server_alias && alias && !strcmp(b->server_alias, alias))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
256 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 } |
16817
10f175539cfe
Change a few functions to free a linked list while iterating through
Mark Doliner <mark@kingant.net>
parents:
16753
diff
changeset
|
259 |
15823 | 260 purple_blist_server_alias_buddy(b, alias); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 |
15823 | 262 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, b->name, account); |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
263 if(conv != NULL && alias != NULL && strcmp(alias, who)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 char *tmp = g_strdup_printf(_("%s is now known as %s.\n"), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 who, alias); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 |
18028 | 268 purple_conversation_write(conv, NULL, tmp, |
269 PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NO_LINKIFY, | |
270 time(NULL)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
271 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
272 g_free(tmp); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
273 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
274 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 |
22332
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
277 void |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
278 purple_serv_got_private_alias(PurpleConnection *gc, const char *who, const char *alias) |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
279 { |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
280 PurpleAccount *account = NULL; |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
281 GSList *buddies = NULL; |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
282 PurpleBuddy *b = NULL; |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
283 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
284 account = purple_connection_get_account(gc); |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
285 buddies = purple_find_buddies(account, who); |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
286 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
287 while(buddies != NULL) { |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
288 b = buddies->data; |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
289 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
290 buddies = g_slist_delete_link(buddies, buddies); |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
291 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
292 if((!b->alias && !alias) || (b->alias && alias && !strcmp(b->alias, alias))) |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
293 continue; |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
294 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
295 purple_blist_alias_buddy(b, alias); |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
296 } |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
297 } |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
298 |
3232cc79fa51
This is part of a patch from felipec, also known as shx, that adds
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22262
diff
changeset
|
299 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
300 PurpleAttentionType *purple_get_attention_type_from_code(PurpleAccount *account, guint type_code) |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
301 { |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
302 PurplePlugin *prpl; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
303 PurpleAttentionType* attn; |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
304 GList *(*get_attention_types)(PurpleAccount *); |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
305 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
306 g_return_val_if_fail(account != NULL, NULL); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
307 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
308 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
309 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
310 /* Lookup the attention type in the protocol's attention_types list, if any. */ |
19711
437c320c8d29
Change attention_types to get_attention_types so this will compile.
Richard Laager <rlaager@wiktel.com>
parents:
19703
diff
changeset
|
311 get_attention_types = PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->get_attention_types; |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
312 if (get_attention_types) { |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
313 GList *attention_types; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
314 |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
315 attention_types = get_attention_types(account); |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
316 attn = (PurpleAttentionType *)g_list_nth_data(attention_types, type_code); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
317 } else { |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
318 attn = NULL; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
319 } |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
320 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
321 return attn; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
322 } |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
323 |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
324 void |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
325 serv_send_attention(PurpleConnection *gc, const char *who, guint type_code) |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
326 { |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
327 PurpleAttentionType *attn; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
328 PurpleMessageFlags flags; |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
329 PurplePlugin *prpl; |
19510
b17bd24fca8d
Don't trigger 'receiving-' and 'received-' signals when sending attention request.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19463
diff
changeset
|
330 PurpleConversation *conv; |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
331 gboolean (*send_attention)(PurpleConnection *, const char *, guint); |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
332 PurpleBuddy *buddy; |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
333 const char *alias; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
334 gchar *description; |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
335 time_t mtime; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
336 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
337 g_return_if_fail(gc != NULL); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
338 g_return_if_fail(who != NULL); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
339 |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
340 prpl = purple_find_prpl(purple_account_get_protocol_id(gc->account)); |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
341 send_attention = PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention; |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
342 g_return_if_fail(send_attention != NULL); |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
343 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
344 mtime = time(NULL); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
345 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
346 attn = purple_get_attention_type_from_code(gc->account, type_code); |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
347 |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
348 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL) |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
349 alias = purple_buddy_get_contact_alias(buddy); |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
350 else |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
351 alias = who; |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
352 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
353 if (attn && purple_attention_type_get_outgoing_desc(attn)) { |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
354 description = g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias); |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
355 } else { |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
356 description = g_strdup_printf(_("Requesting %s's attention..."), alias); |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
357 } |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
358 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
359 flags = PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
360 |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
361 purple_debug_info("server", "serv_send_attention: sending '%s' to %s\n", |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
362 description, who); |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
363 |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
364 if (!send_attention(gc, who, type_code)) |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
365 return; |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
366 |
19510
b17bd24fca8d
Don't trigger 'receiving-' and 'received-' signals when sending attention request.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19463
diff
changeset
|
367 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, gc->account, who); |
b17bd24fca8d
Don't trigger 'receiving-' and 'received-' signals when sending attention request.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19463
diff
changeset
|
368 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, description, flags, mtime); |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
369 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
370 g_free(description); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
371 } |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
372 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
373 void |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
374 serv_got_attention(PurpleConnection *gc, const char *who, guint type_code) |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
375 { |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
376 PurpleMessageFlags flags; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
377 PurpleAttentionType *attn; |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
378 PurpleBuddy *buddy; |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
379 const char *alias; |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
380 gchar *description; |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
381 time_t mtime; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
382 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
383 mtime = time(NULL); |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
384 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
385 attn = purple_get_attention_type_from_code(gc->account, type_code); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
386 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
387 /* PURPLE_MESSAGE_NOTIFY is for attention messages. */ |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
388 flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_RECV; |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
389 |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
390 /* TODO: if (attn->icon_name) is non-null, use it to lookup an emoticon and display |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
391 * it next to the attention command. And if it is null, display a generic icon. */ |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
392 |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
393 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL) |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
394 alias = purple_buddy_get_contact_alias(buddy); |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
395 else |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
396 alias = who; |
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
397 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
398 if (attn && purple_attention_type_get_incoming_desc(attn)) { |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
399 description = g_strdup_printf(purple_attention_type_get_incoming_desc(attn), alias); |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
400 } else { |
19716
a359452f9ea2
Take aliases into account for the attention messages.
Richard Laager <rlaager@wiktel.com>
parents:
19711
diff
changeset
|
401 description = g_strdup_printf(_("%s has requested your attention!"), alias); |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
402 } |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
403 |
19463
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
404 purple_debug_info("server", "serv_got_attention: got '%s' from %s\n", |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
405 description, who); |
3f6f84d11ce2
Change serv_send_attention() to call prpl_info->send_attention(), and
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19461
diff
changeset
|
406 |
19461
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
407 serv_got_im(gc, who, description, flags, mtime); |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
408 |
1b5e786d137a
In the attention API, use the PURPLE_NOTIFY_MESSAGE flag to serv_got_im()
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
19440
diff
changeset
|
409 /* TODO: sounds (depending on PurpleAttentionType), shaking, etc. */ |
19426
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
410 |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
411 g_free(description); |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
412 } |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
413 |
6395c2e96bc2
Attention API for nudges/buzzes/zaps of various protocols.
Jeffrey Connelly <jaconnel@calpoly.edu>
parents:
18238
diff
changeset
|
414 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
415 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
416 * Move a buddy from one group to another on server. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
417 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 * Note: For now we'll not deal with changing gc's at the same time, but |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 * it should be possible. Probably needs to be done, someday. Although, |
15823 | 420 * the UI for that would be difficult, because groups are Purple-wide. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
421 */ |
15823 | 422 void serv_move_buddy(PurpleBuddy *b, PurpleGroup *og, PurpleGroup *ng) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
424 PurpleAccount *account = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
425 PurpleConnection *gc = NULL; |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
426 PurplePlugin *prpl = NULL; |
15823 | 427 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
428 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
429 g_return_if_fail(b != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
430 g_return_if_fail(og != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
431 g_return_if_fail(ng != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
432 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
433 account = purple_buddy_get_account(b); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
434 gc = purple_account_get_connection(account); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
435 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
436 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
437 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
438 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
439 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
440 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
441 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
442 if(gc && og && ng) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
443 if (prpl_info && prpl_info->group_buddy) { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
444 prpl_info->group_buddy(gc, b->name, og->name, ng->name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
445 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
446 } |
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 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
449 void serv_add_permit(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
450 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
451 PurplePlugin *prpl = NULL; |
15823 | 452 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
453 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
454 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
455 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
456 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
457 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
458 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
459 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
460 if(prpl_info && prpl_info->add_permit) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
461 prpl_info->add_permit(gc, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
462 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
463 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
464 void serv_add_deny(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
465 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
466 PurplePlugin *prpl = NULL; |
15823 | 467 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
468 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
469 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
470 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
471 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
472 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
473 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
474 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
475 if(prpl_info && prpl_info->add_deny) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
476 prpl_info->add_deny(gc, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
477 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
478 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
479 void serv_rem_permit(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
480 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
481 PurplePlugin *prpl = NULL; |
15823 | 482 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
483 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
484 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
485 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
486 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
487 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
488 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
489 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
490 if(prpl_info && prpl_info->rem_permit) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
491 prpl_info->rem_permit(gc, name); |
15374
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 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
494 void serv_rem_deny(PurpleConnection *gc, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
495 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
496 PurplePlugin *prpl = NULL; |
15823 | 497 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
499 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
500 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
502 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
503 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
504 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
505 if(prpl_info && prpl_info->rem_deny) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
506 prpl_info->rem_deny(gc, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
509 void serv_set_permit_deny(PurpleConnection *gc) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
511 PurplePlugin *prpl = NULL; |
15823 | 512 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
514 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
515 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
516 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
517 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
518 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
519 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 * this is called when either you import a buddy list, and make lots |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 * of changes that way, or when the user toggles the permit/deny mode |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
523 * in the prefs. In either case you should probably be resetting and |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
524 * resending the permit/deny info when you get this. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
525 */ |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
526 if(prpl_info && prpl_info->set_permit_deny) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
527 prpl_info->set_permit_deny(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
530 void serv_join_chat(PurpleConnection *gc, GHashTable *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
532 PurplePlugin *prpl = NULL; |
15823 | 533 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
535 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
536 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
537 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
538 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
539 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
540 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
541 if(prpl_info && prpl_info->join_chat) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
542 prpl_info->join_chat(gc, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
543 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
544 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
545 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
546 void serv_reject_chat(PurpleConnection *gc, GHashTable *data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
547 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
548 PurplePlugin *prpl = NULL; |
15823 | 549 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
551 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
552 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
554 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
555 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
556 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
557 if(prpl_info && prpl_info->reject_chat) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
558 prpl_info->reject_chat(gc, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
561 void serv_chat_invite(PurpleConnection *gc, int id, const char *message, const char *name) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
563 PurplePlugin *prpl = NULL; |
15823 | 564 PurplePluginProtocolInfo *prpl_info = NULL; |
565 PurpleConversation *conv; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 char *buffy = message && *message ? g_strdup(message) : NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
567 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
568 conv = purple_find_chat(gc, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
570 if(conv == NULL) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
573 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
574 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
575 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
576 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
577 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 |
15823 | 579 purple_signal_emit(purple_conversations_get_handle(), "chat-inviting-user", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 conv, name, &buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 if (prpl_info && prpl_info->chat_invite) |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
583 prpl_info->chat_invite(gc, id, buffy, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
584 |
15823 | 585 purple_signal_emit(purple_conversations_get_handle(), "chat-invited-user", |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 conv, name, buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 g_free(buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 |
15823 | 591 /* Ya know, nothing uses this except purple_conversation_destroy(), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 * I think I'll just merge it into that later... |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 * Then again, something might want to use this, from outside prpl-land |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 * to leave a chat without destroying the conversation. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
597 void serv_chat_leave(PurpleConnection *gc, int id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
599 PurplePlugin *prpl = NULL; |
15823 | 600 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
602 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
604 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
605 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
606 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
607 if(prpl_info && prpl_info->chat_leave) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
608 prpl_info->chat_leave(gc, id); |
15374
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 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
611 void serv_chat_whisper(PurpleConnection *gc, int id, const char *who, const char *message) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
613 PurplePlugin *prpl = NULL; |
15823 | 614 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
616 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
617 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
619 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
620 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
621 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
622 if(prpl_info && prpl_info->chat_whisper) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
623 prpl_info->chat_whisper(gc, id, who, message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
624 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
15823 | 626 int serv_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags) |
15374
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 int val = -EINVAL; |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
629 PurplePlugin *prpl = NULL; |
15823 | 630 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
632 prpl = purple_connection_get_prpl(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
634 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
635 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
636 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
637 if(prpl_info && prpl_info->chat_send) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 val = prpl_info->chat_send(gc, id, message, flags); |
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 return val; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 * woo. i'm actually going to comment this function. isn't that fun. make |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 * sure to follow along, kids |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 */ |
15823 | 647 void serv_got_im(PurpleConnection *gc, const char *who, const char *msg, |
648 PurpleMessageFlags flags, time_t mtime) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 { |
15823 | 650 PurpleAccount *account; |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
651 PurpleConversation *conv; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 char *message, *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 char *angel, *buffy; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 int plugin_return; |
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 g_return_if_fail(msg != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 |
15823 | 658 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
660 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 /* protocol does not support privacy, handle it ourselves */ |
23171
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
662 if (!purple_privacy_check(account, who)) { |
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
663 purple_signal_emit(purple_conversations_get_handle(), "blocked-im-msg", |
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
664 account, who, msg, flags, (unsigned int)mtime); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
665 return; |
23171
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
666 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
667 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
668 |
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 * We should update the conversation window buttons and menu, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
671 * if it exists. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
672 */ |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
673 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, who, gc->account); |
15374
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 /* |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
676 * Make copies of the message and the sender in case plugins want |
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
677 * to free these strings and replace them with a modifed version. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
678 */ |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
679 buffy = g_strdup(msg); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
680 angel = g_strdup(who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
681 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
682 plugin_return = GPOINTER_TO_INT( |
15823 | 683 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
|
684 "receiving-im-msg", gc->account, |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
685 &angel, &buffy, conv, &flags)); |
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 if (!buffy || !angel || plugin_return) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
688 g_free(buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
689 g_free(angel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
690 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
691 } |
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 name = angel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
694 message = buffy; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
695 |
15823 | 696 purple_signal_emit(purple_conversations_get_handle(), "received-im-msg", gc->account, |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
697 name, message, conv, flags); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
698 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
699 /* search for conversation again in case it was created by received-im-msg handler */ |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
700 if (conv == NULL) |
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
701 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
702 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
703 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
704 * XXX: Should we be setting this here, or relying on prpls to set it? |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
705 */ |
15823 | 706 flags |= PURPLE_MESSAGE_RECV; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
707 |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
708 if (conv == NULL) |
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
709 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
710 |
22630
b398fe0a450e
Pass something useful as the 'who' parameter to purple_conv_im_write for
Will Thompson <will.thompson@collabora.co.uk>
parents:
22332
diff
changeset
|
711 purple_conv_im_write(PURPLE_CONV_IM(conv), name, message, flags, mtime); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
712 g_free(message); |
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 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
715 * Don't autorespond if: |
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 * - it's not supported on this connection |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
718 * - we are available |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
719 * - or it's disabled |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
720 * - or we're not idle and the 'only auto respond if idle' pref |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
721 * is set |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
722 */ |
15823 | 723 if (gc->flags & PURPLE_CONNECTION_AUTO_RESP) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
724 { |
15823 | 725 PurplePresence *presence; |
726 PurpleStatus *status; | |
727 PurpleStatusType *status_type; | |
728 PurpleStatusPrimitive primitive; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
729 const gchar *auto_reply_pref; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
730 const char *away_msg = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
731 |
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
|
732 auto_reply_pref = purple_prefs_get_string("/purple/away/auto_reply"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
733 |
15823 | 734 presence = purple_account_get_presence(account); |
735 status = purple_presence_get_active_status(presence); | |
736 status_type = purple_status_get_type(status); | |
737 primitive = purple_status_type_get_primitive(status_type); | |
738 if ((primitive == PURPLE_STATUS_AVAILABLE) || | |
739 (primitive == PURPLE_STATUS_INVISIBLE) || | |
740 (primitive == PURPLE_STATUS_MOBILE) || | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
741 !strcmp(auto_reply_pref, "never") || |
15823 | 742 (!purple_presence_is_idle(presence) && !strcmp(auto_reply_pref, "awayidle"))) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
743 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
744 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
745 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
746 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
747 |
15823 | 748 away_msg = purple_value_get_string( |
749 purple_status_get_attr_value(status, "message")); | |
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 if ((away_msg != NULL) && (*away_msg != '\0')) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
752 struct last_auto_response *lar; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
753 time_t now = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
754 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
755 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
756 * This used to be based on the conversation window. But um, if |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
757 * you went away, and someone sent you a message and got your |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
758 * auto-response, and then you closed the window, and then they |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
759 * sent you another one, they'd get the auto-response back too |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
760 * soon. Besides that, we need to keep track of this even if we've |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
761 * got a queue. So the rest of this block is just the auto-response, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
762 * if necessary. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
763 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
764 lar = get_last_auto_response(gc, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
765 if ((now - lar->sent) >= SECS_BEFORE_RESENDING_AUTORESPONSE) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
766 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
767 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
768 * We don't want to send an autoresponse in response to the other user's |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
769 * autoresponse. We do, however, not want to then send one in response to the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
770 * _next_ message, so we still set lar->sent to now. |
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 lar->sent = now; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
773 |
15823 | 774 if (!(flags & PURPLE_MESSAGE_AUTO_RESP)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
775 { |
15823 | 776 serv_send_im(gc, name, away_msg, PURPLE_MESSAGE_AUTO_RESP); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
777 |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
778 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, away_msg, |
15823 | 779 PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_AUTO_RESP, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
780 mtime); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
781 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
782 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
783 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
784 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
785 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
786 g_free(name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
787 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
788 |
15823 | 789 void serv_got_typing(PurpleConnection *gc, const char *name, int timeout, |
790 PurpleTypingState state) { | |
791 PurpleConversation *conv; | |
792 PurpleConvIm *im = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
793 |
15823 | 794 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
795 if (conv != NULL) { |
15823 | 796 im = PURPLE_CONV_IM(conv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
797 |
15823 | 798 purple_conv_im_set_typing_state(im, state); |
799 purple_conv_im_update_typing(im); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
800 } else { |
17071
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
801 switch (state) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
802 { |
17071
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
803 case PURPLE_TYPING: |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
804 purple_signal_emit(purple_conversations_get_handle(), |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
805 "buddy-typing", gc->account, name); |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
806 break; |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
807 case PURPLE_TYPED: |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
808 purple_signal_emit(purple_conversations_get_handle(), |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
809 "buddy-typed", gc->account, name); |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
810 break; |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
811 case PURPLE_NOT_TYPING: |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
812 purple_signal_emit(purple_conversations_get_handle(), |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
813 "buddy-typing-stopped", gc->account, name); |
bfdd46b72027
Emit the buddy-typing-stopped signal even if we don't have a conversation, and use swtich rather than if
Evan Schoenberg <evan.s@dreskin.net>
parents:
16817
diff
changeset
|
814 break; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
815 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
816 } |
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 if (conv != NULL && timeout > 0) |
15823 | 819 purple_conv_im_start_typing_timeout(im, timeout); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
820 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
821 |
15823 | 822 void serv_got_typing_stopped(PurpleConnection *gc, const char *name) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
823 |
15823 | 824 PurpleConversation *conv; |
825 PurpleConvIm *im; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
826 |
15823 | 827 conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, name, gc->account); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
828 if (conv != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
829 { |
15823 | 830 im = PURPLE_CONV_IM(conv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
831 |
15823 | 832 if (im->typing_state == PURPLE_NOT_TYPING) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
833 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
834 |
15823 | 835 purple_conv_im_stop_typing_timeout(im); |
836 purple_conv_im_set_typing_state(im, PURPLE_NOT_TYPING); | |
837 purple_conv_im_update_typing(im); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
838 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
839 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
840 { |
15823 | 841 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
|
842 "buddy-typing-stopped", gc->account, name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
843 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
844 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
845 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
846 struct chat_invite_data { |
15823 | 847 PurpleConnection *gc; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
848 GHashTable *components; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
849 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
850 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
851 static void chat_invite_data_free(struct chat_invite_data *cid) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
852 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
853 if (cid->components) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
854 g_hash_table_destroy(cid->components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
855 g_free(cid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
856 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
857 |
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 static void chat_invite_reject(struct chat_invite_data *cid) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
860 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
861 serv_reject_chat(cid->gc, cid->components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
862 chat_invite_data_free(cid); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
866 static void chat_invite_accept(struct chat_invite_data *cid) |
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 serv_join_chat(cid->gc, cid->components); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
869 chat_invite_data_free(cid); |
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 |
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 |
15823 | 874 void serv_got_chat_invite(PurpleConnection *gc, const char *name, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
875 const char *who, const char *message, GHashTable *data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
876 { |
15823 | 877 PurpleAccount *account; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
878 char buf2[BUF_LONG]; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
879 struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
880 int plugin_return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
881 |
15823 | 882 account = purple_connection_get_account(gc); |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
883 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc))->set_permit_deny == NULL) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
884 /* protocol does not support privacy, handle it ourselves */ |
23171
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
885 if (!purple_privacy_check(account, who)) { |
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
886 purple_signal_emit(purple_conversations_get_handle(), "chat-invite-blocked", |
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
887 account, who, name, message, data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
888 return; |
23171
ff8ec3d58367
Modified patch from Stefan 'cockroach' Ott to add blocked-im-msg and
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
23105
diff
changeset
|
889 } |
15374
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 |
15823 | 892 plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1( |
893 purple_conversations_get_handle(), | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
894 "chat-invited", account, who, name, message, data)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
895 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
896 cid->gc = gc; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
897 cid->components = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
898 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
899 if (plugin_return == 0) |
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 if (message != NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
902 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
903 g_snprintf(buf2, sizeof(buf2), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
904 _("%s has invited %s to the chat room %s:\n%s"), |
15823 | 905 who, purple_account_get_username(account), name, message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
906 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
907 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
908 g_snprintf(buf2, sizeof(buf2), |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
909 _("%s has invited %s to the chat room %s\n"), |
15823 | 910 who, purple_account_get_username(account), name); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
911 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
912 |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
913 purple_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2, |
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
|
914 PURPLE_DEFAULT_ACTION_NONE, account, who, NULL, |
21099
51cf02dbdb0e
disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
Richard Laager <rlaager@wiktel.com>
parents:
21095
diff
changeset
|
915 cid, G_CALLBACK(chat_invite_accept), |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
916 G_CALLBACK(chat_invite_reject)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
917 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
918 else if (plugin_return > 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
919 chat_invite_accept(cid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
920 else |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
921 chat_invite_reject(cid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
922 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
923 |
15823 | 924 PurpleConversation *serv_got_joined_chat(PurpleConnection *gc, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
925 int id, const char *name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
926 { |
15823 | 927 PurpleConversation *conv; |
928 PurpleConvChat *chat; | |
929 PurpleAccount *account; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
930 |
15823 | 931 account = purple_connection_get_account(gc); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
932 |
15823 | 933 conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); |
934 chat = PURPLE_CONV_CHAT(conv); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
935 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
936 if (!g_slist_find(gc->buddy_chats, conv)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
937 gc->buddy_chats = g_slist_append(gc->buddy_chats, conv); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
938 |
15823 | 939 purple_conv_chat_set_id(chat, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
940 |
15823 | 941 purple_signal_emit(purple_conversations_get_handle(), "chat-joined", conv); |
15374
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 return conv; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
944 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
945 |
15823 | 946 void serv_got_chat_left(PurpleConnection *g, int id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
947 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
948 GSList *bcs; |
15823 | 949 PurpleConversation *conv = NULL; |
950 PurpleConvChat *chat = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
951 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
952 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { |
15823 | 953 conv = (PurpleConversation *)bcs->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
954 |
15823 | 955 chat = PURPLE_CONV_CHAT(conv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
956 |
15823 | 957 if (purple_conv_chat_get_id(chat) == id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
958 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
959 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
960 conv = NULL; |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
963 if (!conv) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
964 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
965 |
15823 | 966 purple_debug(PURPLE_DEBUG_INFO, "server", "Leaving room: %s\n", |
967 purple_conversation_get_name(conv)); | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
968 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
969 g->buddy_chats = g_slist_remove(g->buddy_chats, conv); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
970 |
15823 | 971 purple_conv_chat_left(PURPLE_CONV_CHAT(conv)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
972 |
15823 | 973 purple_signal_emit(purple_conversations_get_handle(), "chat-left", conv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
974 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
975 |
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
|
976 void purple_serv_got_join_chat_failed(PurpleConnection *gc, GHashTable *data) |
22891
43233dc1d40b
applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents:
22753
diff
changeset
|
977 { |
43233dc1d40b
applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents:
22753
diff
changeset
|
978 purple_signal_emit(purple_conversations_get_handle(), "chat-join-failed", |
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
|
979 gc, data); |
22891
43233dc1d40b
applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents:
22753
diff
changeset
|
980 } |
43233dc1d40b
applied changes from 4c5110037671f84e3e775214c32692b5b23c11e1
Evan Schoenberg <evan.s@dreskin.net>
parents:
22753
diff
changeset
|
981 |
15823 | 982 void serv_got_chat_in(PurpleConnection *g, int id, const char *who, |
983 PurpleMessageFlags flags, const char *message, time_t mtime) | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
984 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
985 GSList *bcs; |
15823 | 986 PurpleConversation *conv = NULL; |
987 PurpleConvChat *chat = NULL; | |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
988 char *buffy, *angel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
989 int plugin_return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
990 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
991 g_return_if_fail(who != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
992 g_return_if_fail(message != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
993 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
994 for (bcs = g->buddy_chats; bcs != NULL; bcs = bcs->next) { |
15823 | 995 conv = (PurpleConversation *)bcs->data; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
996 |
15823 | 997 chat = PURPLE_CONV_CHAT(conv); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
998 |
15823 | 999 if (purple_conv_chat_get_id(chat) == id) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1000 break; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1001 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1002 conv = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1003 } |
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 (!conv) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1006 return; |
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 /* |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
1009 * Make copies of the message and the sender in case plugins want |
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
1010 * to free these strings and replace them with a modifed version. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1011 */ |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
1012 buffy = g_strdup(message); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1013 angel = g_strdup(who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1014 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1015 plugin_return = GPOINTER_TO_INT( |
15823 | 1016 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
|
1017 "receiving-chat-msg", g->account, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1018 &angel, &buffy, conv, &flags)); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1019 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1020 if (!buffy || !angel || plugin_return) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1021 g_free(buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1022 g_free(angel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1023 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1024 } |
20569
7393ee28c819
Richard pointed out that this was dumb in an email to the devel
Mark Doliner <mark@kingant.net>
parents:
20063
diff
changeset
|
1025 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1026 who = angel; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1027 message = buffy; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1028 |
15823 | 1029 purple_signal_emit(purple_conversations_get_handle(), "received-chat-msg", g->account, |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1030 who, message, conv, flags); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1031 |
15823 | 1032 purple_conv_chat_write(chat, who, message, flags, mtime); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1033 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1034 g_free(angel); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1035 g_free(buffy); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1036 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1037 |
15823 | 1038 void serv_send_file(PurpleConnection *gc, const char *who, const char *file) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1039 { |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1040 PurplePlugin *prpl = NULL; |
15823 | 1041 PurplePluginProtocolInfo *prpl_info = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1042 |
22262
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1043 if(gc) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1044 prpl = purple_connection_get_prpl(gc); |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1045 |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1046 if(prpl) |
edca47ee06c5
Kill off gc->prpl in the core everywhere but connection.c (when the struct
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21099
diff
changeset
|
1047 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15374
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 if (prpl_info && prpl_info->send_file) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1050 if (!prpl_info->can_receive_file || prpl_info->can_receive_file(gc, who)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1051 prpl_info->send_file(gc, who, file); |
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 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1054 } |