annotate libpurple/prpl.c @ 32481:095254ccea3d

Checkin PurpleStatus API changes.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 02 Sep 2011 04:23:18 +0000
parents 2c58de59bd57
children 5aa171c8776b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /*
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
2 * purple
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
3 *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
4 * Purple is the legal property of its developers, whose names are too numerous
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
5 * to list here. Please refer to the COPYRIGHT file distributed with this
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
6 * source distribution.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 * (at your option) any later version.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 * GNU General Public License for more details.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 19531
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 */
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"
24243
785db7300ef2 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@wiktel.com>
parents: 23616
diff changeset
26 #include "network.h"
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include "notify.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include "prpl.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include "request.h"
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "util.h"
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 /**************************************************************************/
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
33 /** @name Attention Type API */
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
34 /**************************************************************************/
32479
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
35
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
36 /** Represents "nudges" and "buzzes" that you may send to a buddy to attract
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
37 * their attention (or vice-versa).
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
38 */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
39 struct _PurpleAttentionType
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
40 {
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
41 const char *name; /**< Shown in GUI elements */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
42 const char *incoming_description; /**< Shown when sent */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
43 const char *outgoing_description; /**< Shown when receied */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
44 const char *icon_name; /**< Icon to display (optional) */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
45 const char *unlocalized_name; /**< Unlocalized name for UIs needing it */
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
46 };
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
47
2c58de59bd57 Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 31534
diff changeset
48
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
49 PurpleAttentionType *
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
50 purple_attention_type_new(const char *ulname, const char *name,
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
51 const char *inc_desc, const char *out_desc)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
52 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
53 PurpleAttentionType *attn = g_new0(PurpleAttentionType, 1);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
54
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
55 purple_attention_type_set_name(attn, name);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
56 purple_attention_type_set_incoming_desc(attn, inc_desc);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
57 purple_attention_type_set_outgoing_desc(attn, out_desc);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
58 purple_attention_type_set_unlocalized_name(attn, ulname);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
59
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
60 return attn;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
61 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
62
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
63
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
64 void
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
65 purple_attention_type_set_name(PurpleAttentionType *type, const char *name)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
66 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
67 g_return_if_fail(type != NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
68
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
69 type->name = name;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
70 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
71
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
72 void
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
73 purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const char *desc)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
74 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
75 g_return_if_fail(type != NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
76
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
77 type->incoming_description = desc;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
78 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
79
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
80 void
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
81 purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const char *desc)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
82 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
83 g_return_if_fail(type != NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
84
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
85 type->outgoing_description = desc;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
86 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
87
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
88 void
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
89 purple_attention_type_set_icon_name(PurpleAttentionType *type, const char *name)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
90 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
91 g_return_if_fail(type != NULL);
25415
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 25396
diff changeset
92
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
93 type->icon_name = name;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
94 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
95
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
96 void
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
97 purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const char *ulname)
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
98 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
99 g_return_if_fail(type != NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
100
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
101 type->unlocalized_name = ulname;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
102 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
103
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
104 const char *
22122
f55f84a1e3f7 const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22097
diff changeset
105 purple_attention_type_get_name(const PurpleAttentionType *type)
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
106 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
107 g_return_val_if_fail(type != NULL, NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
108
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
109 return type->name;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
110 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
111
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
112 const char *
22122
f55f84a1e3f7 const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22097
diff changeset
113 purple_attention_type_get_incoming_desc(const PurpleAttentionType *type)
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
114 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
115 g_return_val_if_fail(type != NULL, NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
116
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
117 return type->incoming_description;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
118 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
119
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
120 const char *
22122
f55f84a1e3f7 const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22097
diff changeset
121 purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type)
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
122 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
123 g_return_val_if_fail(type != NULL, NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
124
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
125 return type->outgoing_description;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
126 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
127
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
128 const char *
22122
f55f84a1e3f7 const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22097
diff changeset
129 purple_attention_type_get_icon_name(const PurpleAttentionType *type)
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
130 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
131 g_return_val_if_fail(type != NULL, NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
132
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
133 if(type->icon_name == NULL || *(type->icon_name) == '\0')
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
134 return NULL;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
135
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
136 return type->icon_name;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
137 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
138
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
139 const char *
22122
f55f84a1e3f7 const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 22097
diff changeset
140 purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type)
22097
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
141 {
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
142 g_return_val_if_fail(type != NULL, NULL);
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
143
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
144 return type->unlocalized_name;
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
145 }
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
146
eab7d03edfcb This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 21628
diff changeset
147 /**************************************************************************/
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148 /** @name Protocol Plugin API */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 /**************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
151 purple_prpl_got_account_idle(PurpleAccount *account, gboolean idle,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 time_t idle_time)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 g_return_if_fail(account != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
155 g_return_if_fail(purple_account_is_connected(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
157 purple_presence_set_idle(purple_account_get_presence(account),
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 idle, idle_time);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
162 purple_prpl_got_account_login_time(PurpleAccount *account, time_t login_time)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
164 PurplePresence *presence;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 g_return_if_fail(account != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
167 g_return_if_fail(purple_account_is_connected(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169 if (login_time == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 login_time = time(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
172 presence = purple_account_get_presence(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
174 purple_presence_set_login_time(presence, login_time);
15374
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
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
178 purple_prpl_got_account_status(PurpleAccount *account, const char *status_id, ...)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
180 PurplePresence *presence;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
181 PurpleStatus *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 va_list args;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 g_return_if_fail(status_id != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
186 g_return_if_fail(purple_account_is_connected(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
188 presence = purple_account_get_presence(account);
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
189 status = purple_presence_get_status(presence, status_id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
190
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 g_return_if_fail(status != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 va_start(args, status_id);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
194 purple_status_set_active_with_attrs(status, TRUE, args);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 va_end(args);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 void
26776
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
199 purple_prpl_got_account_actions(PurpleAccount *account)
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
200 {
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
201
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
202 g_return_if_fail(account != NULL);
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
203 g_return_if_fail(purple_account_is_connected(account));
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
204
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
205 purple_signal_emit(purple_accounts_get_handle(), "account-actions-changed",
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
206 account);
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
207 }
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
208
83e6e710cbf3 Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <paul@darkrain42.org>
parents: 26606
diff changeset
209 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
210 purple_prpl_got_user_idle(PurpleAccount *account, const char *name,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 gboolean idle, time_t idle_time)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
213 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: 16920
diff changeset
214 GSList *list;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 g_return_if_fail(name != NULL);
24957
8c2631eb5da7 I think it's reasonable for prpls to call purple_prpl_got_user_idle()
Mark Doliner <mark@kingant.net>
parents: 24243
diff changeset
218 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
220 if ((list = purple_find_buddies(account, name)) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
223 while (list) {
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
224 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: 16920
diff changeset
225 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: 16920
diff changeset
226 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: 16920
diff changeset
227 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
231 purple_prpl_got_user_login_time(PurpleAccount *account, const char *name,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 time_t login_time)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 {
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
234 GSList *list;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
235 PurplePresence *presence;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 g_return_if_fail(name != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
240 if ((list = purple_find_buddies(account, name)) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
243 if (login_time == 0)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
244 login_time = time(NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
245
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
246 while (list) {
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
247 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: 16920
diff changeset
248 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: 16920
diff changeset
249 list = g_slist_delete_link(list, list);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
250
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
251 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: 16920
diff changeset
252 {
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
253 purple_presence_set_login_time(presence, login_time);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
254
18104
e4d21d4dfcca Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16920
diff changeset
255 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: 16920
diff changeset
256 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
257 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
259
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
261 purple_prpl_got_user_status(PurpleAccount *account, const char *name,
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 const char *status_id, ...)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 {
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
264 GSList *list, *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
265 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
266 PurplePresence *presence;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
267 PurpleStatus *status;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
268 PurpleStatus *old_status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
269 va_list args;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
270
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
271 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
272 g_return_if_fail(name != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
273 g_return_if_fail(status_id != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
274 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
275
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
276 if((list = purple_find_buddies(account, name)) == NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
277 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
278
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
279 for(l = list; l != NULL; l = l->next) {
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
280 buddy = l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
281
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
282 presence = purple_buddy_get_presence(buddy);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
283 status = purple_presence_get_status(presence, status_id);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
284
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
285 if(NULL == status)
27610
0d0f153565f5 Add a comment
Mark Doliner <mark@kingant.net>
parents: 27422
diff changeset
286 /*
0d0f153565f5 Add a comment
Mark Doliner <mark@kingant.net>
parents: 27422
diff changeset
287 * TODO: This should never happen, right? We should call
0d0f153565f5 Add a comment
Mark Doliner <mark@kingant.net>
parents: 27422
diff changeset
288 * g_warning() or something.
0d0f153565f5 Add a comment
Mark Doliner <mark@kingant.net>
parents: 27422
diff changeset
289 */
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
290 continue;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
291
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
292 old_status = purple_presence_get_active_status(presence);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
293
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
294 va_start(args, status_id);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
295 purple_status_set_active_with_attrs(status, TRUE, args);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
296 va_end(args);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
297
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
298 purple_blist_update_buddy_status(buddy, old_status);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
299 }
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
300
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 g_slist_free(list);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
302
27422
2518c5fcd8a2 Make the comment reflect that we are actually just stopping the typing
Etan Reisner <pidgin@unreliablesource.net>
parents: 26776
diff changeset
303 /* The buddy is no longer online, they are therefore by definition not
2518c5fcd8a2 Make the comment reflect that we are actually just stopping the typing
Etan Reisner <pidgin@unreliablesource.net>
parents: 26776
diff changeset
304 * still typing to us. */
29529
7a6c114c1a49 Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
maiku@pidgin.im
parents: 29528
diff changeset
305 if (!purple_status_is_online(status)) {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
306 serv_got_typing_stopped(purple_account_get_connection(account), name);
29529
7a6c114c1a49 Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
maiku@pidgin.im
parents: 29528
diff changeset
307 purple_prpl_got_media_caps(account, name);
7a6c114c1a49 Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
maiku@pidgin.im
parents: 29528
diff changeset
308 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
310
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
311 void purple_prpl_got_user_status_deactive(PurpleAccount *account, const char *name,
15524
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: 15374
diff changeset
312 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: 15374
diff changeset
313 {
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
314 GSList *list, *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
315 PurpleBuddy *buddy;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
316 PurplePresence *presence;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
317 PurpleStatus *status;
15524
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: 15374
diff changeset
318
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: 15374
diff changeset
319 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: 15374
diff changeset
320 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: 15374
diff changeset
321 g_return_if_fail(status_id != NULL);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
322 g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account));
15524
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: 15374
diff changeset
323
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
324 if((list = purple_find_buddies(account, name)) == NULL)
15524
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: 15374
diff changeset
325 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: 15374
diff changeset
326
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
327 for(l = list; l != NULL; l = l->next) {
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
328 buddy = l->data;
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
329
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
330 presence = purple_buddy_get_presence(buddy);
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
331 status = purple_presence_get_status(presence, status_id);
15524
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: 15374
diff changeset
332
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
333 if(NULL == status)
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
334 continue;
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
335
19531
ecc6019f0a82 Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19476
diff changeset
336 if (purple_status_is_active(status)) {
ecc6019f0a82 Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19476
diff changeset
337 purple_status_set_active(status, FALSE);
ecc6019f0a82 Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19476
diff changeset
338 purple_blist_update_buddy_status(buddy, status);
ecc6019f0a82 Deactivate only an active status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19476
diff changeset
339 }
16920
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
340 }
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
341
d177369ce625 this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents: 15823
diff changeset
342 g_slist_free(list);
15524
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: 15374
diff changeset
343 }
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: 15374
diff changeset
344
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
346 do_prpl_change_account_status(PurpleAccount *account,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
347 PurpleStatus *old_status, PurpleStatus *new_status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
348 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
349 PurplePlugin *prpl;
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
350 PurplePluginProtocolInfo *prpl_info;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
351
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
352 if (purple_status_is_online(new_status) &&
24243
785db7300ef2 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@wiktel.com>
parents: 23616
diff changeset
353 purple_account_is_disconnected(account) &&
785db7300ef2 Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@wiktel.com>
parents: 23616
diff changeset
354 purple_network_is_available())
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
355 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
356 purple_account_connect(account);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
358 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
360 if (!purple_status_is_online(new_status))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
361 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
362 if (!purple_account_is_disconnected(account))
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
363 purple_account_disconnect(account);
20219
d68db74b7165 applied changes from c9d6104bcfe2e630e98e45bc6a0975adfb9544e5
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
364 /* Clear out the unsaved password if we're already disconnected and we switch to offline status */
d68db74b7165 applied changes from c9d6104bcfe2e630e98e45bc6a0975adfb9544e5
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
365 else if (!purple_account_get_remember_password(account))
d68db74b7165 applied changes from c9d6104bcfe2e630e98e45bc6a0975adfb9544e5
Richard Laager <rlaager@wiktel.com>
parents: 19680
diff changeset
366 purple_account_set_password(account, NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
370 if (purple_account_is_connecting(account))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
371 /*
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 * 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
373 * 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
374 * connection process.
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 */
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
376 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
378 prpl = purple_find_prpl(purple_account_get_protocol_id(account));
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
379
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 if (prpl == NULL)
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 return;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
382
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
383 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
385 if (!purple_account_is_disconnected(account) && prpl_info->set_status != NULL)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 prpl_info->set_status(account, new_status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
388 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
391 void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
392 purple_prpl_change_account_status(PurpleAccount *account,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
393 PurpleStatus *old_status, PurpleStatus *new_status)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
394 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395 g_return_if_fail(account != NULL);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
396 g_return_if_fail(new_status != NULL);
21628
495f2f1de998 old_status can be NULL when [de]activating a non-exclusive status.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20219
diff changeset
397 g_return_if_fail(!purple_status_is_exclusive(new_status) || old_status != NULL);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
399 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
400
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
401 purple_signal_emit(purple_accounts_get_handle(), "account-status-changed",
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
402 account, old_status, new_status);
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
404
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
405 GList *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
406 purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *presence)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 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
409 GList *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
410 PurpleStatus *status;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
411
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412 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
413 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
414
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
415 for (l = purple_account_get_status_types(account); l != NULL; l = l->next)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
417 status = purple_status_new((PurpleStatusType *)l->data, presence);
15594
f485c87e6546 sf patch #1655057, from Peter Tang
Mark Doliner <mark@kingant.net>
parents: 15524
diff changeset
418 statuses = g_list_prepend(statuses, status);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420
15594
f485c87e6546 sf patch #1655057, from Peter Tang
Mark Doliner <mark@kingant.net>
parents: 15524
diff changeset
421 statuses = g_list_reverse(statuses);
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
423 return statuses;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
424 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
425
29706
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
426 static void
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
427 purple_prpl_attention(PurpleConversation *conv, const char *who,
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
428 guint type, PurpleMessageFlags flags, time_t mtime)
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
429 {
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
430 PurpleAccount *account = purple_conversation_get_account(conv);
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
431 purple_signal_emit(purple_conversations_get_handle(),
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
432 flags == PURPLE_MESSAGE_SEND ? "sent-attention" : "got-attention",
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
433 account, who, conv, type);
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
434 }
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
435
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
436 void
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
437 purple_prpl_send_attention(PurpleConnection *gc, const char *who, guint type_code)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
438 {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
439 PurpleAttentionType *attn;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
440 PurpleMessageFlags flags;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
441 PurplePlugin *prpl;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
442 PurpleConversation *conv;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
443 gboolean (*send_attention)(PurpleConnection *, const char *, guint);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
444 PurpleBuddy *buddy;
25415
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 25396
diff changeset
445 const char *alias;
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
446 gchar *description;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
447 time_t mtime;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
448
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
449 g_return_if_fail(gc != NULL);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
450 g_return_if_fail(who != NULL);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
451
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
452 prpl = purple_find_prpl(purple_account_get_protocol_id(gc->account));
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
453 send_attention = PURPLE_PLUGIN_PROTOCOL_INFO(prpl)->send_attention;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
454 g_return_if_fail(send_attention != NULL);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
455
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
456 mtime = time(NULL);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
457
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
458 attn = purple_get_attention_type_from_code(gc->account, type_code);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
459
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
460 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
461 alias = purple_buddy_get_contact_alias(buddy);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
462 else
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
463 alias = who;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
464
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
465 if (attn && purple_attention_type_get_outgoing_desc(attn)) {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
466 description = g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
467 } else {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
468 description = g_strdup_printf(_("Requesting %s's attention..."), alias);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
469 }
25415
584063555949 Remove trailing whitespace
Mark Doliner <mark@kingant.net>
parents: 25396
diff changeset
470
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
471 flags = PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
472
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
473 purple_debug_info("server", "serv_send_attention: sending '%s' to %s\n",
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
474 description, who);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
475
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
476 if (!send_attention(gc, who, type_code))
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
477 return;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
478
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
479 conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, gc->account, who);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
480 purple_conv_im_write(PURPLE_CONV_IM(conv), NULL, description, flags, mtime);
29706
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
481 purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_SEND, time(NULL));
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
482
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
483 g_free(description);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
484 }
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
485
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
486 static void
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
487 got_attention(PurpleConnection *gc, int id, const char *who, guint type_code)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
488 {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
489 PurpleMessageFlags flags;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
490 PurpleAttentionType *attn;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
491 PurpleBuddy *buddy;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
492 const char *alias;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
493 gchar *description;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
494 time_t mtime;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
495
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
496 mtime = time(NULL);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
497
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
498 attn = purple_get_attention_type_from_code(gc->account, type_code);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
499
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
500 /* PURPLE_MESSAGE_NOTIFY is for attention messages. */
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
501 flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_RECV;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
502
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
503 /* TODO: if (attn->icon_name) is non-null, use it to lookup an emoticon and display
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
504 * it next to the attention command. And if it is null, display a generic icon. */
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
505
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
506 if ((buddy = purple_find_buddy(purple_connection_get_account(gc), who)) != NULL)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
507 alias = purple_buddy_get_contact_alias(buddy);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
508 else
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
509 alias = who;
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
510
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
511 if (attn && purple_attention_type_get_incoming_desc(attn)) {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
512 description = g_strdup_printf(purple_attention_type_get_incoming_desc(attn), alias);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
513 } else {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
514 description = g_strdup_printf(_("%s has requested your attention!"), alias);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
515 }
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
516
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
517 purple_debug_info("server", "got_attention: got '%s' from %s\n",
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
518 description, who);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
519
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
520 if (id == -1)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
521 serv_got_im(gc, who, description, flags, mtime);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
522 else
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
523 serv_got_chat_in(gc, id, who, flags, description, mtime);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
524
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
525 /* TODO: sounds (depending on PurpleAttentionType), shaking, etc. */
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
526
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
527 g_free(description);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
528 }
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
529
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
530 void
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
531 purple_prpl_got_attention(PurpleConnection *gc, const char *who, guint type_code)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
532 {
29704
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
533 PurpleConversation *conv = NULL;
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
534 PurpleAccount *account = purple_connection_get_account(gc);
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
535
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
536 got_attention(gc, -1, who, type_code);
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29728
diff changeset
537 conv =
29704
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
538 purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, who, account);
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
539 if (conv)
29706
163f6c3cbdd9 Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <ml@update.uu.se>
parents: 29705
diff changeset
540 purple_prpl_attention(conv, who, type_code, PURPLE_MESSAGE_RECV,
29704
9198a5d39c5c Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <ml@update.uu.se>
parents: 29702
diff changeset
541 time(NULL));
23616
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
542 }
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
543
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
544 void
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
545 purple_prpl_got_attention_in_chat(PurpleConnection *gc, int id, const char *who, guint type_code)
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
546 {
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
547 got_attention(gc, id, who, type_code);
49850f7ca393 Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 22122
diff changeset
548 }
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
549
26447
34eb898478b4 Don't assume a PurpleMedia instance will be created immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26434
diff changeset
550 gboolean
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
551 purple_prpl_initiate_media(PurpleAccount *account,
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
552 const char *who,
25720
551a462b346a Changed PurpleMediaStreamType to PurpleMediaSessionType.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 25719
diff changeset
553 PurpleMediaSessionType type)
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
554 {
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
555 #ifdef USE_VV
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
556 PurpleConnection *gc = NULL;
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
557 PurplePlugin *prpl = NULL;
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
558 PurplePluginProtocolInfo *prpl_info = NULL;
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
559
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
560 if (account)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
561 gc = purple_account_get_connection(account);
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
562 if (gc)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
563 prpl = purple_connection_get_prpl(gc);
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
564 if (prpl)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
565 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
566
25719
1aa383ee5fc8 Fixed up media functions in prpl.c and prpl.h, adding more documentation and
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 25718
diff changeset
567 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, initiate_media)) {
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
568 /* should check that the protocol supports this media type here? */
26606
df9042312063 Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26447
diff changeset
569 return prpl_info->initiate_media(account, who, type);
26447
34eb898478b4 Don't assume a PurpleMedia instance will be created immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26434
diff changeset
570 } else
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
571 #endif
26447
34eb898478b4 Don't assume a PurpleMedia instance will be created immediately.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26434
diff changeset
572 return FALSE;
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
573 }
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
574
26190
d6e23439b77c Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26136
diff changeset
575 PurpleMediaCaps
d6e23439b77c Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26136
diff changeset
576 purple_prpl_get_media_caps(PurpleAccount *account, const char *who)
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
577 {
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
578 #ifdef USE_VV
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
579 PurpleConnection *gc = NULL;
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
580 PurplePlugin *prpl = NULL;
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
581 PurplePluginProtocolInfo *prpl_info = NULL;
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29728
diff changeset
582
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
583 if (account)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
584 gc = purple_account_get_connection(account);
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
585 if (gc)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
586 prpl = purple_connection_get_prpl(gc);
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
587 if (prpl)
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
588 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29728
diff changeset
589
26190
d6e23439b77c Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26136
diff changeset
590 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info,
d6e23439b77c Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26136
diff changeset
591 get_media_caps)) {
26606
df9042312063 Switch media to store accounts rather than connections.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26447
diff changeset
592 return prpl_info->get_media_caps(account, who);
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
593 }
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
594 #endif
26190
d6e23439b77c Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26136
diff changeset
595 return PURPLE_MEDIA_CAPS_NONE;
25709
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
596 }
eb8c8a926589 Convert serv_* media functions to purple_prpl_* functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 22122
diff changeset
597
29528
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
598 void
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
599 purple_prpl_got_media_caps(PurpleAccount *account, const char *name)
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
600 {
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
601 #ifdef USE_VV
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
602 GSList *list;
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
603
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
604 g_return_if_fail(account != NULL);
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
605 g_return_if_fail(name != NULL);
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
606
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
607 if ((list = purple_find_buddies(account, name)) == NULL)
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
608 return;
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
609
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
610 while (list) {
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
611 PurpleBuddy *buddy = list->data;
29728
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
612 PurpleMediaCaps oldcaps = purple_buddy_get_media_caps(buddy);
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
613 PurpleMediaCaps newcaps = 0;
29532
c5712737e59a Essentially normalize the username passed to purple_prpl_got_media_caps.
maiku@pidgin.im
parents: 29531
diff changeset
614 const gchar *bname = purple_buddy_get_name(buddy);
29528
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
615 list = g_slist_delete_link(list, list);
29531
33715feb7b8d Add media_caps to PurpleBuddy structure and use it to determine the old caps
maiku@pidgin.im
parents: 29529
diff changeset
616
31534
a8cc50c2279f Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents: 29728
diff changeset
617
29728
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
618 newcaps = purple_prpl_get_media_caps(account, bname);
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
619 purple_buddy_set_media_caps(buddy, newcaps);
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
620
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
621 if (oldcaps == newcaps)
29531
33715feb7b8d Add media_caps to PurpleBuddy structure and use it to determine the old caps
maiku@pidgin.im
parents: 29529
diff changeset
622 continue;
29528
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
623
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
624 purple_signal_emit(purple_blist_get_handle(),
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
625 "buddy-caps-changed", buddy,
29728
31a34388fb1d update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents: 29709
diff changeset
626 newcaps, oldcaps);
29528
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
627 }
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
628 #endif
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
629 }
4f14b03a9d50 Add the purple_media_got_media_caps function in order to signal when a prpl
maiku@pidgin.im
parents: 27610
diff changeset
630
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
631 /**************************************************************************
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
632 * Protocol Plugin Subsystem API
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
633 **************************************************************************/
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
634
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
635 PurplePlugin *
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
636 purple_find_prpl(const char *id)
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
637 {
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
638 GList *l;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
639 PurplePlugin *plugin;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
640
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
641 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
642
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
643 for (l = purple_plugins_get_protocols(); l != NULL; l = l->next) {
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15594
diff changeset
644 plugin = (PurplePlugin *)l->data;
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
645
25385
a6e3cb32cdd2 Patch from Paul Aurich to add purple_strequal to help readability and simplicity of code. Ie, don't need to negate the value of strcmp, since this does a strcmp and does the negation for us
Paul Aurich <paul@darkrain42.org>
parents: 24243
diff changeset
646 if (purple_strequal(plugin->info->id, id))
15374
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
647 return plugin;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
648 }
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
649
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
650 return NULL;
5fe8042783c1 Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
651 }