Mercurial > pidgin
annotate libpurple/prpl.c @ 19556:11de4598b4c5
Document the function to reattach conv-ui.
Introduce the conversation-hiding and conversation-displayed signals in pidgin.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 31 Aug 2007 18:02:09 +0000 |
parents | ecc6019f0a82 |
children | 44b4e8bd759b |
rev | line source |
---|---|
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
15822 | 2 * purple |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
15822 | 4 * Purple is the legal property of its developers, whose names are too numerous |
15373
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
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 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "conversation.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #include "debug.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "notify.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "prpl.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 #include "request.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 #include "util.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 /** @name Protocol Plugin API */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 /**************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 void |
15822 | 35 purple_prpl_got_account_idle(PurpleAccount *account, gboolean idle, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
36 time_t idle_time) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 g_return_if_fail(account != NULL); |
15822 | 39 g_return_if_fail(purple_account_is_connected(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 |
15822 | 41 purple_presence_set_idle(purple_account_get_presence(account), |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 idle, idle_time); |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 void |
15822 | 46 purple_prpl_got_account_login_time(PurpleAccount *account, time_t login_time) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
47 { |
15822 | 48 PurplePresence *presence; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
49 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
50 g_return_if_fail(account != NULL); |
15822 | 51 g_return_if_fail(purple_account_is_connected(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 if (login_time == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
54 login_time = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
15822 | 56 presence = purple_account_get_presence(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
57 |
15822 | 58 purple_presence_set_login_time(presence, login_time); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
59 } |
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 void |
15822 | 62 purple_prpl_got_account_status(PurpleAccount *account, const char *status_id, ...) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
63 { |
15822 | 64 PurplePresence *presence; |
65 PurpleStatus *status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
66 va_list args; |
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 g_return_if_fail(account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
69 g_return_if_fail(status_id != NULL); |
15822 | 70 g_return_if_fail(purple_account_is_connected(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
71 |
15822 | 72 presence = purple_account_get_presence(account); |
73 status = purple_presence_get_status(presence, status_id); | |
15373
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 g_return_if_fail(status != NULL); |
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 va_start(args, status_id); |
15822 | 78 purple_status_set_active_with_attrs(status, TRUE, args); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
79 va_end(args); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
80 } |
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 void |
15822 | 83 purple_prpl_got_user_idle(PurpleAccount *account, const char *name, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
84 gboolean idle, time_t idle_time) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
85 { |
15822 | 86 PurplePresence *presence; |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
87 GSList *list; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
88 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
89 g_return_if_fail(account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
90 g_return_if_fail(name != NULL); |
15822 | 91 g_return_if_fail(purple_account_is_connected(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
92 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
93 if ((list = purple_find_buddies(account, name)) == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
94 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
95 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
96 while (list) { |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
97 presence = purple_buddy_get_presence(list->data); |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
98 list = g_slist_delete_link(list, list); |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
99 purple_presence_set_idle(presence, idle, idle_time); |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
100 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
101 } |
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 void |
15822 | 104 purple_prpl_got_user_login_time(PurpleAccount *account, const char *name, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 time_t login_time) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 { |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
107 GSList *list; |
15822 | 108 PurplePresence *presence; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
110 g_return_if_fail(account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 g_return_if_fail(name != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
113 if ((list = purple_find_buddies(account, name)) == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
115 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 if (login_time == 0) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
117 login_time = time(NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
118 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
119 while (list) { |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
120 PurpleBuddy *buddy = list->data; |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
121 presence = purple_buddy_get_presence(buddy); |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
122 list = g_slist_delete_link(list, list); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
123 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
124 if (purple_presence_get_login_time(presence) != login_time) |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
125 { |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
126 purple_presence_set_login_time(presence, login_time); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
127 |
18104
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
128 purple_signal_emit(purple_blist_get_handle(), "buddy-got-login-time", buddy); |
e4d21d4dfcca
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
16909
diff
changeset
|
129 } |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
130 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
131 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
132 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
133 void |
15822 | 134 purple_prpl_got_user_status(PurpleAccount *account, const char *name, |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
135 const char *status_id, ...) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
136 { |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
137 GSList *list, *l; |
15822 | 138 PurpleBuddy *buddy; |
139 PurplePresence *presence; | |
140 PurpleStatus *status; | |
141 PurpleStatus *old_status; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
142 va_list args; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
143 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
144 g_return_if_fail(account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
145 g_return_if_fail(name != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
146 g_return_if_fail(status_id != NULL); |
15822 | 147 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
148 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
149 if((list = purple_find_buddies(account, name)) == NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
150 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
151 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
152 for(l = list; l != NULL; l = l->next) { |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
153 buddy = l->data; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
154 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
155 presence = purple_buddy_get_presence(buddy); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
156 status = purple_presence_get_status(presence, status_id); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
157 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
158 if(NULL == status) |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
159 continue; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
160 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
161 old_status = purple_presence_get_active_status(presence); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
162 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
163 va_start(args, status_id); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
164 purple_status_set_active_with_attrs(status, TRUE, args); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
165 va_end(args); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
166 |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
167 purple_blist_update_buddy_status(buddy, old_status); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
168 } |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
169 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
170 g_slist_free(list); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
171 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
172 /* we get to re-use the last status we found */ |
15822 | 173 if (!purple_status_is_online(status)) |
174 serv_got_typing_stopped(purple_account_get_connection(account), name); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
175 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
176 |
15822 | 177 void purple_prpl_got_user_status_deactive(PurpleAccount *account, const char *name, |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
178 const char *status_id) |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
179 { |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
180 GSList *list, *l; |
15822 | 181 PurpleBuddy *buddy; |
182 PurplePresence *presence; | |
183 PurpleStatus *status; | |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
184 |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
185 g_return_if_fail(account != NULL); |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
186 g_return_if_fail(name != NULL); |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
187 g_return_if_fail(status_id != NULL); |
15822 | 188 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account)); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
189 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
190 if((list = purple_find_buddies(account, name)) == NULL) |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
191 return; |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
192 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
193 for(l = list; l != NULL; l = l->next) { |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
194 buddy = l->data; |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
195 |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
196 presence = purple_buddy_get_presence(buddy); |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
197 status = purple_presence_get_status(presence, status_id); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
198 |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
199 if(NULL == status) |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
200 continue; |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
201 |
19531
ecc6019f0a82
Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19476
diff
changeset
|
202 if (purple_status_is_active(status)) { |
ecc6019f0a82
Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19476
diff
changeset
|
203 purple_status_set_active(status, FALSE); |
ecc6019f0a82
Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19476
diff
changeset
|
204 purple_blist_update_buddy_status(buddy, status); |
ecc6019f0a82
Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19476
diff
changeset
|
205 } |
16909
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
206 } |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
207 |
d177369ce625
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15822
diff
changeset
|
208 g_slist_free(list); |
15523
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
209 } |
84b3ab83df35
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@gmail.com>
parents:
15373
diff
changeset
|
210 |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
211 static void |
15822 | 212 do_prpl_change_account_status(PurpleAccount *account, |
213 PurpleStatus *old_status, PurpleStatus *new_status) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
214 { |
15822 | 215 PurplePlugin *prpl; |
216 PurplePluginProtocolInfo *prpl_info; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
217 |
15822 | 218 if (purple_status_is_online(new_status) && |
219 purple_account_is_disconnected(account)) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
220 { |
15822 | 221 purple_account_connect(account); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
222 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
223 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
224 |
15822 | 225 if (!purple_status_is_online(new_status)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
226 { |
15822 | 227 if (!purple_account_is_disconnected(account)) |
228 purple_account_disconnect(account); | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 |
15822 | 232 if (purple_account_is_connecting(account)) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 /* |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 * We don't need to call the set_status PRPL function because |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 * the PRPL will take care of setting its status during the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 * connection process. |
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 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 |
15822 | 240 prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 if (prpl == NULL) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
243 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 |
15822 | 245 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 |
15822 | 247 if (!purple_account_is_disconnected(account) && prpl_info->set_status != NULL) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 prpl_info->set_status(account, new_status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 void |
15822 | 254 purple_prpl_change_account_status(PurpleAccount *account, |
255 PurpleStatus *old_status, PurpleStatus *new_status) | |
15373
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 g_return_if_fail(account != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 g_return_if_fail(old_status != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
259 g_return_if_fail(new_status != NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
260 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
261 do_prpl_change_account_status(account, old_status, new_status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
262 |
15822 | 263 purple_signal_emit(purple_accounts_get_handle(), "account-status-changed", |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
264 account, old_status, new_status); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
265 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
266 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
267 GList * |
15822 | 268 purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *presence) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
269 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
270 GList *statuses = NULL; |
18118
ab6d2763b8d8
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@wiktel.com>
parents:
18104
diff
changeset
|
271 GList *l; |
15822 | 272 PurpleStatus *status; |
15373
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 g_return_val_if_fail(account != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 g_return_val_if_fail(presence != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 |
15822 | 277 for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 { |
15822 | 279 status = purple_status_new((PurpleStatusType *)l->data, presence); |
15593
f485c87e6546
sf patch #1655057, from Peter Tang
Mark Doliner <mark@kingant.net>
parents:
15523
diff
changeset
|
280 statuses = g_list_prepend(statuses, status); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
15593
f485c87e6546
sf patch #1655057, from Peter Tang
Mark Doliner <mark@kingant.net>
parents:
15523
diff
changeset
|
283 statuses = g_list_reverse(statuses); |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 return statuses; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 /************************************************************************** |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 * Protocol Plugin Subsystem API |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 **************************************************************************/ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 |
15822 | 293 PurplePlugin * |
294 purple_find_prpl(const char *id) | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
295 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
296 GList *l; |
15822 | 297 PurplePlugin *plugin; |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
298 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
299 g_return_val_if_fail(id != NULL, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
300 |
15822 | 301 for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) { |
302 plugin = (PurplePlugin *)l->data; | |
15373
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 if (!strcmp(plugin->info->id, id)) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 return plugin; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
307 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 return NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 } |