libpurple/protocols.c

Wed, 16 Nov 2022 22:37:33 -0600

author
Gary Kramlich <grim@reaperworld.com>
date
Wed, 16 Nov 2022 22:37:33 -0600
changeset 41919
8c277214ce6f
parent 41894
92fb22f0f0ab
child 41960
c8a4853205e3
permissions
-rw-r--r--

Move PurpleProtocolChatEntry to purpleprotocolchat.h

Also remove the boxed code as nothing was using it as a boxed type anyways.

Testing Done:
Compiled

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

981
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
1 /*
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
2 * purple
981
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7956
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7956
diff changeset
6 * source distribution.
6460
fc288e7221ca [gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
7 *
981
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
11 * (at your option) any later version.
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
12 *
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
16 * GNU General Public License for more details.
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
17 *
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
19859
71d37b57eff2 The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19692
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
981
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
21 *
00723c9a507c [gaim-migrate @ 991]
Eric Warmenhoven <warmenhoven@yahoo.com>
parents:
diff changeset
22 */
40441
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40128
diff changeset
23
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40128
diff changeset
24 #include <glib/gi18n-lib.h>
f23c7e772667 Make sure we're not including the gettext macros in header files and deal with the repercussions of that.
Gary Kramlich <grim@reaperworld.com>
parents: 40128
diff changeset
25
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
26 #include "debug.h"
24519
d4af3d043211 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents: 23875
diff changeset
27 #include "network.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
28 #include "notify.h"
39970
cc7d4ff5a205 rename accountopt.[ch] to purpleaccountoption.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 39921
diff changeset
29 #include "purpleaccountoption.h"
40853
d3518ff99fa7 rename conversation.[ch] to purpleconversation.[ch] and split PurpleConversationUiOps out to its own file to avoid circular include issues.
Gary Kramlich <grim@reaperworld.com>
parents: 40807
diff changeset
30 #include "purpleconversation.h"
40992
3a973a9c5a64 migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents: 40885
diff changeset
31 #include "purpleconversationmanager.h"
40680
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
32 #include "purplecredentialmanager.h"
41155
922c9e70900c Rename protocol.[ch] to purpleprotocol.[ch]
Gary Kramlich <grim@reaperworld.com>
parents: 41137
diff changeset
33 #include "purpleprotocol.h"
40735
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
34 #include "purpleprotocolmanager.h"
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
35 #include "purpleprotocolmedia.h"
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40680
diff changeset
36 #include "purpleprotocolserver.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
37 #include "request.h"
41137
3c1574216aed Now that the History API is here, remove the purple logging api
Gary Kramlich <grim@reaperworld.com>
parents: 40992
diff changeset
38 #include "server.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5717
diff changeset
39 #include "util.h"
3738
1dea426a205b [gaim-migrate @ 3876]
Rob Flynn <gaim@robflynn.com>
parents: 3733
diff changeset
40
22225
6cd802a8c5ad This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21720
diff changeset
41 /**************************************************************************/
37075
cf3f735b09b7 Merge gtkdoc-conversion
Ankit Vani <a@nevitus.org>
parents: 35472 36868
diff changeset
42 /* Protocol API */
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
43 /**************************************************************************/
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
44 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
45 purple_protocol_got_account_idle(PurpleAccount *account, gboolean idle,
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
46 time_t idle_time)
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
47 {
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
48 g_return_if_fail(account != NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
49 g_return_if_fail(purple_account_is_connected(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
50
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
51 purple_presence_set_idle(purple_account_get_presence(account),
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
52 idle, idle_time);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
53 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
54
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
55 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
56 purple_protocol_got_account_login_time(PurpleAccount *account, time_t login_time)
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
57 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
58 PurplePresence *presence;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
59
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
60 g_return_if_fail(account != NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
61 g_return_if_fail(purple_account_is_connected(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
62
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
63 if (login_time == 0)
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
64 login_time = time(NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
65
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
66 presence = purple_account_get_presence(account);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
67
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
68 purple_presence_set_login_time(presence, login_time);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
69 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
70
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
71 void
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
72 purple_protocol_got_account_status_with_attributes(PurpleAccount *account,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
73 const gchar *status_id,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
74 GHashTable *attributes)
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
75 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
76 PurplePresence *presence;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
77 PurpleStatus *status;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
78
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
79 g_return_if_fail(account != NULL);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
80 g_return_if_fail(status_id != NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
81 g_return_if_fail(purple_account_is_connected(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
82
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
83 presence = purple_account_get_presence(account);
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
84 status = purple_presence_get_status(presence, status_id);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
85
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
86 g_return_if_fail(status != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
87
41782
5fb843f4e356 Merge purple_status_set_active_with_attrs{,_dict}
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41781
diff changeset
88 purple_status_set_active_with_attributes(status, TRUE, attributes);
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
89 }
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
90
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
91 void
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
92 purple_protocol_got_account_status(PurpleAccount *account, const char *status_id, ...)
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
93 {
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
94 GHashTable *attributes = NULL;
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
95 va_list args;
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
96
13374
e5da5325b1fa [gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 13335
diff changeset
97 va_start(args, status_id);
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
98 attributes = purple_attrs_from_vargs(args);
13374
e5da5325b1fa [gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 13335
diff changeset
99 va_end(args);
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
100
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
101 purple_protocol_got_account_status_with_attributes(account, status_id,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
102 attributes);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
103
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
104 g_hash_table_destroy(attributes);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
105 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
106
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
107 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
108 purple_protocol_got_account_actions(PurpleAccount *account)
26871
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
109 {
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
110
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
111 g_return_if_fail(account != NULL);
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
112 g_return_if_fail(purple_account_is_connected(account));
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
113
36868
1aca7f52f1ef Backed out the previous 4 changesets. GSignals do not seem feasible with pidgin's architecture using any method.
Ankit Vani <a@nevitus.org>
parents: 36867
diff changeset
114 purple_signal_emit(purple_accounts_get_handle(), "account-actions-changed",
1aca7f52f1ef Backed out the previous 4 changesets. GSignals do not seem feasible with pidgin's architecture using any method.
Ankit Vani <a@nevitus.org>
parents: 36867
diff changeset
115 account);
26871
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
116 }
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
117
d62964222795 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents: 26746
diff changeset
118 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
119 purple_protocol_got_user_idle(PurpleAccount *account, const char *name,
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
120 gboolean idle, time_t idle_time)
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
121 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
122 PurplePresence *presence;
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
123 GSList *list;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
124
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
125 g_return_if_fail(account != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
126 g_return_if_fail(name != NULL);
25428
05aef3d5e63e I think it's reasonable for prpls to call purple_prpl_got_user_idle()
Mark Doliner <markdoliner@pidgin.im>
parents: 24519
diff changeset
127 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
128
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
129 if ((list = purple_blist_find_buddies(account, name)) == NULL)
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
130 return;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
131
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
132 while (list) {
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
133 presence = purple_buddy_get_presence(list->data);
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
134 list = g_slist_delete_link(list, list);
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
135 purple_presence_set_idle(presence, idle, idle_time);
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
136 }
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
137 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
138
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
139 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
140 purple_protocol_got_user_login_time(PurpleAccount *account, const char *name,
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
141 time_t login_time)
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
142 {
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
143 GSList *list;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
144 PurplePresence *presence;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
145
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
146 g_return_if_fail(account != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
147 g_return_if_fail(name != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
148
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
149 if ((list = purple_blist_find_buddies(account, name)) == NULL)
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
150 return;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
151
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
152 if (login_time == 0)
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
153 login_time = time(NULL);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
154
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
155 while (list) {
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
156 PurpleBuddy *buddy = list->data;
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
157 presence = purple_buddy_get_presence(buddy);
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
158 list = g_slist_delete_link(list, list);
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
159
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
160 if (purple_presence_get_login_time(presence) != login_time)
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
161 {
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
162 purple_presence_set_login_time(presence, login_time);
15212
2919bfea7c4a [gaim-migrate @ 17936]
Evan Schoenberg <evands@pidgin.im>
parents: 14254
diff changeset
163
18177
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
164 purple_signal_emit(purple_blist_get_handle(), "buddy-got-login-time", buddy);
6733196cafc6 Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16958
diff changeset
165 }
15311
f5cf28c6e665 [gaim-migrate @ 18039]
Evan Schoenberg <evands@pidgin.im>
parents: 15212
diff changeset
166 }
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
167 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
168
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
169 void
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
170 purple_protocol_got_user_status_with_attributes(PurpleAccount *account,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
171 const gchar *name,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
172 const gchar *status_id,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
173 GHashTable *attributes)
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
174 {
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
175 GSList *list, *l;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
176 PurpleBuddy *buddy;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
177 PurplePresence *presence;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
178 PurpleStatus *status;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
179 PurpleStatus *old_status;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
180
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
181 g_return_if_fail(account != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
182 g_return_if_fail(name != NULL);
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
183 g_return_if_fail(status_id != NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
184 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
185
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
186 if((list = purple_blist_find_buddies(account, name)) == NULL) {
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
187 return;
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
188 }
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
189
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
190 for(l = list; l != NULL; l = l->next) {
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
191 buddy = l->data;
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
192
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
193 presence = purple_buddy_get_presence(buddy);
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
194 status = purple_presence_get_status(presence, status_id);
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
195
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
196 if(NULL == status) {
27786
630525efd6b0 Add a comment
Mark Doliner <markdoliner@pidgin.im>
parents: 27596
diff changeset
197 /*
630525efd6b0 Add a comment
Mark Doliner <markdoliner@pidgin.im>
parents: 27596
diff changeset
198 * TODO: This should never happen, right? We should call
630525efd6b0 Add a comment
Mark Doliner <markdoliner@pidgin.im>
parents: 27596
diff changeset
199 * g_warning() or something.
630525efd6b0 Add a comment
Mark Doliner <markdoliner@pidgin.im>
parents: 27596
diff changeset
200 */
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
201 continue;
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
202 }
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
203
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
204 old_status = purple_presence_get_active_status(presence);
12176
ee1aea253ce3 [gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12126
diff changeset
205
41782
5fb843f4e356 Merge purple_status_set_active_with_attrs{,_dict}
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41781
diff changeset
206 purple_status_set_active_with_attributes(status, TRUE, attributes);
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
207
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
208 purple_buddy_update_status(buddy, old_status);
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
209 }
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
210
12126
3b70215e9630 [gaim-migrate @ 14426]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 12108
diff changeset
211 g_slist_free(list);
12654
2e25e75190c4 [gaim-migrate @ 14997]
Mark Doliner <markdoliner@pidgin.im>
parents: 12377
diff changeset
212
27596
bc7058e10c04 Make the comment reflect that we are actually just stopping the typing
Etan Reisner <deryni@pidgin.im>
parents: 26871
diff changeset
213 /* The buddy is no longer online, they are therefore by definition not
bc7058e10c04 Make the comment reflect that we are actually just stopping the typing
Etan Reisner <deryni@pidgin.im>
parents: 26871
diff changeset
214 * still typing to us. */
29544
dc16ec0027ae Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
Michael Ruprecht <maiku@pidgin.im>
parents: 29543
diff changeset
215 if (!purple_status_is_online(status)) {
35501
602747bb4af9 Fix duplicate prefixes
Ankit Vani <a@nevitus.org>
parents: 35499
diff changeset
216 purple_serv_got_typing_stopped(purple_account_get_connection(account), name);
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
217 purple_protocol_got_media_caps(account, name);
29544
dc16ec0027ae Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
Michael Ruprecht <maiku@pidgin.im>
parents: 29543
diff changeset
218 }
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
219 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
220
41781
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
221 void
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
222 purple_protocol_got_user_status(PurpleAccount *account, const gchar *name,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
223 const gchar *status_id, ...)
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
224 {
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
225 GHashTable *attributes = NULL;
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
226 va_list args;
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
227
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
228 va_start(args, status_id);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
229 attributes = purple_attrs_from_vargs(args);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
230 va_end(args);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
231
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
232 purple_protocol_got_user_status_with_attributes(account, name, status_id,
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
233 attributes);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
234
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
235 g_hash_table_destroy(attributes);
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
236 }
5891e14ae316 Add introspectable versions of purple_protocol_got_{account,user}_status
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41685
diff changeset
237
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
238 void purple_protocol_got_user_status_deactive(PurpleAccount *account, const char *name,
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
239 const char *status_id)
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
240 {
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
241 GSList *list, *l;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
242 PurpleBuddy *buddy;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
243 PurplePresence *presence;
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
244 PurpleStatus *status;
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
245
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
246 g_return_if_fail(account != NULL);
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
247 g_return_if_fail(name != NULL);
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
248 g_return_if_fail(status_id != NULL);
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
249 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
250
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
251 if((list = purple_blist_find_buddies(account, name)) == NULL)
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
252 return;
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
253
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
254 for(l = list; l != NULL; l = l->next) {
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
255 buddy = l->data;
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
256
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
257 presence = purple_buddy_get_presence(buddy);
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
258 status = purple_presence_get_status(presence, status_id);
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
259
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
260 if(NULL == status)
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
261 continue;
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
262
19692
06e6aba21930 Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19654
diff changeset
263 if (purple_status_is_active(status)) {
06e6aba21930 Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19654
diff changeset
264 purple_status_set_active(status, FALSE);
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
265 purple_buddy_update_status(buddy, status);
19692
06e6aba21930 Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19654
diff changeset
266 }
16958
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
267 }
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
268
c95f16df72f6 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15884
diff changeset
269 g_slist_free(list);
15588
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
270 }
e6e89a427ed5 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@pidgin.im>
parents: 15435
diff changeset
271
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
272 static void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
273 do_protocol_change_account_status(PurpleAccount *account,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
274 PurpleStatus *old_status, PurpleStatus *new_status)
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
275 {
36544
1bf8b6ef5aea Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents: 36543
diff changeset
276 PurpleProtocol *protocol;
40735
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
277 PurpleProtocolManager *manager;
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
278
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
279 if (purple_status_is_online(new_status) &&
24519
d4af3d043211 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents: 23875
diff changeset
280 purple_account_is_disconnected(account) &&
d4af3d043211 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents: 23875
diff changeset
281 purple_network_is_available())
11718
90804d019837 [gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents: 11628
diff changeset
282 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
283 purple_account_connect(account);
11718
90804d019837 [gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents: 11628
diff changeset
284 return;
90804d019837 [gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents: 11628
diff changeset
285 }
90804d019837 [gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents: 11628
diff changeset
286
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
287 if (!purple_status_is_online(new_status))
14224
d6d41ff969df [gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14097
diff changeset
288 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
289 if (!purple_account_is_disconnected(account))
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
290 purple_account_disconnect(account);
34146
99bad5c80d1e More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents: 34029
diff changeset
291 /* Clear out the unsaved password if we switch to offline status */
40680
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
292 if (!purple_account_get_remember_password(account)) {
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
293 PurpleCredentialManager *manager = NULL;
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
294
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
295 manager = purple_credential_manager_get_default();
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
296
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
297 purple_credential_manager_clear_password_async(manager, account,
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
298 NULL, NULL, NULL);
f9ea6d5e8992 Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents: 40634
diff changeset
299 }
34019
bc87f596bb4c compile, appears to work too.
Ka-Hing Cheung <khc@pidgin.im>
parents: 34018
diff changeset
300
14224
d6d41ff969df [gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14097
diff changeset
301 return;
d6d41ff969df [gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14097
diff changeset
302 }
11718
90804d019837 [gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents: 11628
diff changeset
303
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
304 if (purple_account_is_connecting(account))
12108
a74fd0d6b79c [gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11948
diff changeset
305 /*
36637
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36631
diff changeset
306 * We don't need to call the set_status protocol function because
9b0109ae118d Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents: 36631
diff changeset
307 * the protocol will take care of setting its status during the
12108
a74fd0d6b79c [gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11948
diff changeset
308 * connection process.
a74fd0d6b79c [gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11948
diff changeset
309 */
a74fd0d6b79c [gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11948
diff changeset
310 return;
a74fd0d6b79c [gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 11948
diff changeset
311
40735
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
312 manager = purple_protocol_manager_get_default();
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
313 protocol = purple_protocol_manager_find(manager,
cc0679f47fd9 Create a new PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents: 40708
diff changeset
314 purple_account_get_protocol_id(account));
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
315
41282
c47df057a426 Silence warning from changing status of the demo protocol
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41176
diff changeset
316 if (!PURPLE_IS_PROTOCOL_SERVER(protocol)) {
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
317 return;
41282
c47df057a426 Silence warning from changing status of the demo protocol
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41176
diff changeset
318 }
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
319
40708
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40680
diff changeset
320 if(!purple_account_is_disconnected(account)) {
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40680
diff changeset
321 purple_protocol_server_set_status(PURPLE_PROTOCOL_SERVER(protocol),
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40680
diff changeset
322 account, new_status);
53a26c29d26c Move the PurpleProtocolServer interface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40680
diff changeset
323 }
9949
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
324 }
377cd65fab3d [gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents: 9460
diff changeset
325
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
326 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
327 purple_protocol_change_account_status(PurpleAccount *account,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15657
diff changeset
328 PurpleStatus *old_status, PurpleStatus *new_status)
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
329 {
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
330 g_return_if_fail(account != NULL);
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
331 g_return_if_fail(new_status != NULL);
21720
235394d5c7f4 Pull a bunch of bugfix only changes to im.pidgin.pidgin.2.3.1,
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20115
diff changeset
332 g_return_if_fail(!purple_status_is_exclusive(new_status) || old_status != NULL);
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
333
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
334 do_protocol_change_account_status(account, old_status, new_status);
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
335
36868
1aca7f52f1ef Backed out the previous 4 changesets. GSignals do not seem feasible with pidgin's architecture using any method.
Ankit Vani <a@nevitus.org>
parents: 36867
diff changeset
336 purple_signal_emit(purple_accounts_get_handle(), "account-status-changed",
1aca7f52f1ef Backed out the previous 4 changesets. GSignals do not seem feasible with pidgin's architecture using any method.
Ankit Vani <a@nevitus.org>
parents: 36867
diff changeset
337 account, old_status, new_status);
12304
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
338 }
e849bc5e8d5d [gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 12176
diff changeset
339
10006
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
340 GList *
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
341 purple_protocol_get_statuses(PurpleAccount *account, PurplePresence *presence)
10006
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
342 {
10447
887380ec66f5 [gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents: 10052
diff changeset
343 g_return_val_if_fail(account != NULL, NULL);
10006
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
344 g_return_val_if_fail(presence != NULL, NULL);
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
345
40783
4f197d3e42d6 Use g_list_copy_deep instead of manual copy/transform
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40735
diff changeset
346 return g_list_copy_deep(purple_account_get_status_types(account),
4f197d3e42d6 Use g_list_copy_deep instead of manual copy/transform
Arkadiy Illarionov <qarkai@gmail.com>
parents: 40735
diff changeset
347 (GCopyFunc)purple_status_new, presence);
10006
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
348 }
800a81666868 [gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents: 9949
diff changeset
349
26495
52846ebe1c7d Don't assume a PurpleMedia instance will be created immediately.
Michael Ruprecht <maiku@pidgin.im>
parents: 26482
diff changeset
350 gboolean
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
351 purple_protocol_initiate_media(PurpleAccount *account,
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
352 const char *who,
26108
8d0fd2f195aa Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents: 26107
diff changeset
353 PurpleMediaSessionType type)
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
354 {
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
355 PurpleConnection *gc = NULL;
36544
1bf8b6ef5aea Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents: 36543
diff changeset
356 PurpleProtocol *protocol = NULL;
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
357
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
358 if(account) {
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
359 gc = purple_account_get_connection(account);
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
360 }
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
361 if(gc) {
36623
caaadef03507 Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents: 36620
diff changeset
362 protocol = purple_connection_get_protocol(gc);
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
363 }
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
364
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
365 if(PURPLE_IS_PROTOCOL_MEDIA(protocol)) {
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
366 PurpleProtocolMedia *media = PURPLE_PROTOCOL_MEDIA(protocol);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
367
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
368 return purple_protocol_media_initiate_session(media, account, who,
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
369 type);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
370 } else {
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
371 return FALSE;
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
372 }
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
373 }
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
374
26316
950c0d491c0d Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents: 26260
diff changeset
375 PurpleMediaCaps
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
376 purple_protocol_get_media_caps(PurpleAccount *account, const char *who)
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
377 {
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
378 PurpleConnection *gc = NULL;
36544
1bf8b6ef5aea Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents: 36543
diff changeset
379 PurpleProtocol *protocol = NULL;
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 29670
diff changeset
380
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
381 if(account) {
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
382 gc = purple_account_get_connection(account);
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
383 }
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
384 if(gc) {
36623
caaadef03507 Renamed purple_connection_get_protocol_info() to purple_connection_get_protocol()
Ankit Vani <a@nevitus.org>
parents: 36620
diff changeset
385 protocol = purple_connection_get_protocol(gc);
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
386 }
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 29670
diff changeset
387
40525
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
388 if(PURPLE_IS_PROTOCOL_MEDIA(protocol)) {
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
389 return purple_protocol_media_get_caps(PURPLE_PROTOCOL_MEDIA(protocol),
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
390 account, who);
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
391 } else {
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
392 return PURPLE_MEDIA_CAPS_NONE;
96fc115d6c36 Move PurpleProtocolMediaInterface to its own file.
Gary Kramlich <grim@reaperworld.com>
parents: 40441
diff changeset
393 }
26099
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
394 }
2ba28e840a95 Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents: 22251
diff changeset
395
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
396 void
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
397 purple_protocol_got_media_caps(PurpleAccount *account, const char *name)
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
398 {
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
399 GSList *list;
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
400
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
401 g_return_if_fail(account != NULL);
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
402 g_return_if_fail(name != NULL);
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
403
34728
8efd73063ecf Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents: 34656
diff changeset
404 if ((list = purple_blist_find_buddies(account, name)) == NULL)
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
405 return;
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
406
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
407 while (list) {
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
408 PurpleBuddy *buddy = list->data;
29670
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
409 PurpleMediaCaps oldcaps = purple_buddy_get_media_caps(buddy);
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
410 PurpleMediaCaps newcaps = 0;
29547
debae7802d68 Essentially normalize the username passed to purple_prpl_got_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents: 29546
diff changeset
411 const gchar *bname = purple_buddy_get_name(buddy);
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
412 list = g_slist_delete_link(list, list);
29546
5858906c0f7b Add media_caps to PurpleBuddy structure and use it to determine the old caps
Michael Ruprecht <maiku@pidgin.im>
parents: 29544
diff changeset
413
31294
73607ab89c6f Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents: 29670
diff changeset
414
36545
23b59a16c808 Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents: 36544
diff changeset
415 newcaps = purple_protocol_get_media_caps(account, bname);
29670
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
416 purple_buddy_set_media_caps(buddy, newcaps);
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
417
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
418 if (oldcaps == newcaps)
29546
5858906c0f7b Add media_caps to PurpleBuddy structure and use it to determine the old caps
Michael Ruprecht <maiku@pidgin.im>
parents: 29544
diff changeset
419 continue;
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
420
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
421 purple_signal_emit(purple_blist_get_handle(),
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
422 "buddy-caps-changed", buddy,
29670
c1d3cb9db1d7 update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29653
diff changeset
423 newcaps, oldcaps);
29543
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
424 }
4e38799c741e Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents: 27786
diff changeset
425 }

mercurial