Thu, 29 Aug 2013 23:38:19 +0530
Use the purple_protocol_iface_* API instead of protocol->function()
| 981 | 1 | /* |
| 15884 | 2 | * purple |
| 981 | 3 | * |
| 15884 | 4 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 6 | * source distribution. | |
|
6460
fc288e7221ca
[gaim-migrate @ 6969]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
7 | * |
| 981 | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by | |
| 10 | * the Free Software Foundation; either version 2 of the License, or | |
| 11 | * (at your option) any later version. | |
| 12 | * | |
| 13 | * This program is distributed in the hope that it will be useful, | |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | * GNU General Public License for more details. | |
| 17 | * | |
| 18 | * You should have received a copy of the GNU General Public License | |
| 19 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19692
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 981 | 21 | * |
| 22 | */ | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
23 | #include "internal.h" |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
24 | #include "accountopt.h" |
|
5945
941f14d90d22
[gaim-migrate @ 6386]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
25 | #include "conversation.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
26 | #include "debug.h" |
|
24519
d4af3d043211
Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents:
23875
diff
changeset
|
27 | #include "network.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
28 | #include "notify.h" |
|
36543
a8c3fecee2d3
Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents:
36537
diff
changeset
|
29 | #include "protocol.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
30 | #include "request.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5717
diff
changeset
|
31 | #include "util.h" |
| 3738 | 32 | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
33 | static GHashTable *protocols = NULL; |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
34 | |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
35 | /**************************************************************************/ |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
36 | /** @name Attention Type API */ |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
37 | /**************************************************************************/ |
|
32302
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
38 | |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
39 | struct _PurpleAttentionType |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
40 | { |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
41 | const char *name; /**< Shown in GUI elements */ |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
42 | const char *incoming_description; /**< Shown when sent */ |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
43 | const char *outgoing_description; /**< Shown when receied */ |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
44 | const char *icon_name; /**< Icon to display (optional) */ |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
45 | const char *unlocalized_name; /**< Unlocalized name for UIs needing it */ |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
46 | }; |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
47 | |
|
8d7ae15354e1
Hide PurpleAttentionType struct and remove attention @since tags.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
31294
diff
changeset
|
48 | |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
49 | PurpleAttentionType * |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
50 | purple_attention_type_new(const char *ulname, const char *name, |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
51 | const char *inc_desc, const char *out_desc) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
52 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
53 | PurpleAttentionType *attn = g_new0(PurpleAttentionType, 1); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
54 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
55 | purple_attention_type_set_name(attn, name); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
56 | purple_attention_type_set_incoming_desc(attn, inc_desc); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
57 | purple_attention_type_set_outgoing_desc(attn, out_desc); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
58 | purple_attention_type_set_unlocalized_name(attn, ulname); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
59 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
60 | return attn; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
61 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
62 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
63 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
64 | void |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
65 | purple_attention_type_set_name(PurpleAttentionType *type, const char *name) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
66 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
67 | g_return_if_fail(type != NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
68 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
69 | type->name = name; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
70 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
71 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
72 | void |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
73 | purple_attention_type_set_incoming_desc(PurpleAttentionType *type, const char *desc) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
74 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
75 | g_return_if_fail(type != NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
76 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
77 | type->incoming_description = desc; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
78 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
79 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
80 | void |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
81 | purple_attention_type_set_outgoing_desc(PurpleAttentionType *type, const char *desc) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
82 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
83 | g_return_if_fail(type != NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
84 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
85 | type->outgoing_description = desc; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
86 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
87 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
88 | void |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
89 | purple_attention_type_set_icon_name(PurpleAttentionType *type, const char *name) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
90 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
91 | g_return_if_fail(type != NULL); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
92 | |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
93 | type->icon_name = name; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
94 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
95 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
96 | void |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
97 | purple_attention_type_set_unlocalized_name(PurpleAttentionType *type, const char *ulname) |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
98 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
99 | g_return_if_fail(type != NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
100 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
101 | type->unlocalized_name = ulname; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
102 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
103 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
104 | const char * |
|
22251
a7c65a128467
const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22225
diff
changeset
|
105 | purple_attention_type_get_name(const PurpleAttentionType *type) |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
106 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
107 | g_return_val_if_fail(type != NULL, NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
108 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
109 | return type->name; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
110 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
111 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
112 | const char * |
|
22251
a7c65a128467
const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22225
diff
changeset
|
113 | purple_attention_type_get_incoming_desc(const PurpleAttentionType *type) |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
114 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
115 | g_return_val_if_fail(type != NULL, NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
116 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
117 | return type->incoming_description; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
118 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
119 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
120 | const char * |
|
22251
a7c65a128467
const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22225
diff
changeset
|
121 | purple_attention_type_get_outgoing_desc(const PurpleAttentionType *type) |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
122 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
123 | g_return_val_if_fail(type != NULL, NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
124 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
125 | return type->outgoing_description; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
126 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
127 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
128 | const char * |
|
22251
a7c65a128467
const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22225
diff
changeset
|
129 | purple_attention_type_get_icon_name(const PurpleAttentionType *type) |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
130 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
131 | g_return_val_if_fail(type != NULL, NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
132 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
133 | if(type->icon_name == NULL || *(type->icon_name) == '\0') |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
134 | return NULL; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
135 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
136 | return type->icon_name; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
137 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
138 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
139 | const char * |
|
22251
a7c65a128467
const-ify paramteters to some of the new API I added. I thought I did this already.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22225
diff
changeset
|
140 | purple_attention_type_get_unlocalized_name(const PurpleAttentionType *type) |
|
22225
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
141 | { |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
142 | g_return_val_if_fail(type != NULL, NULL); |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
143 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
144 | return type->unlocalized_name; |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
145 | } |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
146 | |
|
6cd802a8c5ad
This adds accessor and mutator API for the PurpleAttentionType struct.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
21720
diff
changeset
|
147 | /**************************************************************************/ |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
148 | /** @name Protocol Plugin API */ |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
149 | /**************************************************************************/ |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
150 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
151 | purple_protocol_got_account_idle(PurpleAccount *account, gboolean idle, |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
152 | time_t idle_time) |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
153 | { |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
154 | g_return_if_fail(account != NULL); |
| 15884 | 155 | g_return_if_fail(purple_account_is_connected(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
156 | |
| 15884 | 157 | purple_presence_set_idle(purple_account_get_presence(account), |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
158 | idle, idle_time); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
159 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
160 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
161 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
162 | purple_protocol_got_account_login_time(PurpleAccount *account, time_t login_time) |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
163 | { |
| 15884 | 164 | PurplePresence *presence; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
165 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
166 | g_return_if_fail(account != NULL); |
| 15884 | 167 | g_return_if_fail(purple_account_is_connected(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
168 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
169 | if (login_time == 0) |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
170 | login_time = time(NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
171 | |
| 15884 | 172 | presence = purple_account_get_presence(account); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
173 | |
| 15884 | 174 | purple_presence_set_login_time(presence, login_time); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
175 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
176 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
177 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
178 | purple_protocol_got_account_status(PurpleAccount *account, const char *status_id, ...) |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
179 | { |
| 15884 | 180 | PurplePresence *presence; |
| 181 | PurpleStatus *status; | |
|
13374
e5da5325b1fa
[gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13335
diff
changeset
|
182 | va_list args; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
183 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
184 | g_return_if_fail(account != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
185 | g_return_if_fail(status_id != NULL); |
| 15884 | 186 | g_return_if_fail(purple_account_is_connected(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
187 | |
| 15884 | 188 | presence = purple_account_get_presence(account); |
| 189 | status = purple_presence_get_status(presence, status_id); | |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
190 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
191 | g_return_if_fail(status != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
192 | |
|
13374
e5da5325b1fa
[gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13335
diff
changeset
|
193 | va_start(args, status_id); |
| 15884 | 194 | purple_status_set_active_with_attrs(status, TRUE, args); |
|
13374
e5da5325b1fa
[gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13335
diff
changeset
|
195 | va_end(args); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
196 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
197 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
198 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
199 | purple_protocol_got_account_actions(PurpleAccount *account) |
|
26871
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
200 | { |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
201 | |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
202 | g_return_if_fail(account != NULL); |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
203 | g_return_if_fail(purple_account_is_connected(account)); |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
204 | |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
205 | purple_signal_emit(purple_accounts_get_handle(), "account-actions-changed", |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
206 | account); |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
207 | } |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
208 | |
|
d62964222795
Add a new signal which is emitted (after the account is connected) if the
Paul Aurich <darkrain42@pidgin.im>
parents:
26746
diff
changeset
|
209 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
210 | purple_protocol_got_user_idle(PurpleAccount *account, const char *name, |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
211 | gboolean idle, time_t idle_time) |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
212 | { |
| 15884 | 213 | PurplePresence *presence; |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
214 | GSList *list; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
215 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
216 | g_return_if_fail(account != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
217 | g_return_if_fail(name != NULL); |
|
25428
05aef3d5e63e
I think it's reasonable for prpls to call purple_prpl_got_user_idle()
Mark Doliner <markdoliner@pidgin.im>
parents:
24519
diff
changeset
|
218 | g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
219 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
220 | if ((list = purple_blist_find_buddies(account, name)) == NULL) |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
221 | return; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
222 | |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
223 | while (list) { |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
224 | presence = purple_buddy_get_presence(list->data); |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
225 | list = g_slist_delete_link(list, list); |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
226 | purple_presence_set_idle(presence, idle, idle_time); |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
227 | } |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
228 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
229 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
230 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
231 | purple_protocol_got_user_login_time(PurpleAccount *account, const char *name, |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
232 | time_t login_time) |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
233 | { |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
234 | GSList *list; |
| 15884 | 235 | PurplePresence *presence; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
236 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
237 | g_return_if_fail(account != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
238 | g_return_if_fail(name != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
239 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
240 | if ((list = purple_blist_find_buddies(account, name)) == NULL) |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
241 | return; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
242 | |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
243 | if (login_time == 0) |
|
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
244 | login_time = time(NULL); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
245 | |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
246 | while (list) { |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
247 | PurpleBuddy *buddy = list->data; |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
248 | presence = purple_buddy_get_presence(buddy); |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
249 | list = g_slist_delete_link(list, list); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
250 | |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
251 | if (purple_presence_get_login_time(presence) != login_time) |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
252 | { |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
253 | purple_presence_set_login_time(presence, login_time); |
|
15212
2919bfea7c4a
[gaim-migrate @ 17936]
Evan Schoenberg <evands@pidgin.im>
parents:
14254
diff
changeset
|
254 | |
|
18177
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
255 | purple_signal_emit(purple_blist_get_handle(), "buddy-got-login-time", buddy); |
|
6733196cafc6
Update the idleness and login-time for all the blistnodes of the same buddy.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16958
diff
changeset
|
256 | } |
|
15311
f5cf28c6e665
[gaim-migrate @ 18039]
Evan Schoenberg <evands@pidgin.im>
parents:
15212
diff
changeset
|
257 | } |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
258 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
259 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
260 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
261 | purple_protocol_got_user_status(PurpleAccount *account, const char *name, |
|
13374
e5da5325b1fa
[gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13335
diff
changeset
|
262 | const char *status_id, ...) |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
263 | { |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
264 | GSList *list, *l; |
| 15884 | 265 | PurpleBuddy *buddy; |
| 266 | PurplePresence *presence; | |
| 267 | PurpleStatus *status; | |
| 268 | PurpleStatus *old_status; | |
|
13374
e5da5325b1fa
[gaim-migrate @ 15746]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13335
diff
changeset
|
269 | va_list args; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
270 | |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
271 | g_return_if_fail(account != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
272 | g_return_if_fail(name != NULL); |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
273 | g_return_if_fail(status_id != NULL); |
| 15884 | 274 | g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
275 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
276 | if((list = purple_blist_find_buddies(account, name)) == NULL) |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
277 | return; |
|
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
278 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
279 | for(l = list; l != NULL; l = l->next) { |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
280 | buddy = l->data; |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
281 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
282 | presence = purple_buddy_get_presence(buddy); |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
283 | status = purple_presence_get_status(presence, status_id); |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
284 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
285 | if(NULL == status) |
| 27786 | 286 | /* |
| 287 | * TODO: This should never happen, right? We should call | |
| 288 | * g_warning() or something. | |
| 289 | */ | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
290 | continue; |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
291 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
292 | old_status = purple_presence_get_active_status(presence); |
|
12176
ee1aea253ce3
[gaim-migrate @ 14478]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12126
diff
changeset
|
293 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
294 | va_start(args, status_id); |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
295 | purple_status_set_active_with_attrs(status, TRUE, args); |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
296 | va_end(args); |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
297 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
298 | purple_buddy_update_status(buddy, old_status); |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
299 | } |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
300 | |
|
12126
3b70215e9630
[gaim-migrate @ 14426]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12108
diff
changeset
|
301 | g_slist_free(list); |
|
12654
2e25e75190c4
[gaim-migrate @ 14997]
Mark Doliner <markdoliner@pidgin.im>
parents:
12377
diff
changeset
|
302 | |
|
27596
bc7058e10c04
Make the comment reflect that we are actually just stopping the typing
Etan Reisner <deryni@pidgin.im>
parents:
26871
diff
changeset
|
303 | /* The buddy is no longer online, they are therefore by definition not |
|
bc7058e10c04
Make the comment reflect that we are actually just stopping the typing
Etan Reisner <deryni@pidgin.im>
parents:
26871
diff
changeset
|
304 | * still typing to us. */ |
|
29544
dc16ec0027ae
Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
Michael Ruprecht <maiku@pidgin.im>
parents:
29543
diff
changeset
|
305 | if (!purple_status_is_online(status)) { |
| 15884 | 306 | serv_got_typing_stopped(purple_account_get_connection(account), name); |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
307 | purple_protocol_got_media_caps(account, name); |
|
29544
dc16ec0027ae
Use purple_prpl_got_media_caps in purple_prpl_got_user_status to remove media
Michael Ruprecht <maiku@pidgin.im>
parents:
29543
diff
changeset
|
308 | } |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
309 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
310 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
311 | void purple_protocol_got_user_status_deactive(PurpleAccount *account, const char *name, |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
312 | const char *status_id) |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
313 | { |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
314 | GSList *list, *l; |
| 15884 | 315 | PurpleBuddy *buddy; |
| 316 | PurplePresence *presence; | |
| 317 | PurpleStatus *status; | |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
318 | |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
319 | g_return_if_fail(account != NULL); |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
320 | g_return_if_fail(name != NULL); |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
321 | g_return_if_fail(status_id != NULL); |
| 15884 | 322 | g_return_if_fail(purple_account_is_connected(account) || purple_account_is_connecting(account)); |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
323 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
324 | if((list = purple_blist_find_buddies(account, name)) == NULL) |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
325 | return; |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
326 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
327 | for(l = list; l != NULL; l = l->next) { |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
328 | buddy = l->data; |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
329 | |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
330 | presence = purple_buddy_get_presence(buddy); |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
331 | status = purple_presence_get_status(presence, status_id); |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
332 | |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
333 | if(NULL == status) |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
334 | continue; |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
335 | |
|
19692
06e6aba21930
Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19654
diff
changeset
|
336 | if (purple_status_is_active(status)) { |
|
06e6aba21930
Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19654
diff
changeset
|
337 | purple_status_set_active(status, FALSE); |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
338 | purple_buddy_update_status(buddy, status); |
|
19692
06e6aba21930
Deactivate only an active status.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
19654
diff
changeset
|
339 | } |
|
16958
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
340 | } |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
341 | |
|
c95f16df72f6
this should fix 647, and a few others
Nathan Walp <nwalp@pidgin.im>
parents:
15884
diff
changeset
|
342 | g_slist_free(list); |
|
15588
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
343 | } |
|
e6e89a427ed5
Use the status API to handle mobileness, and convert AIM to use it. This makes mobile buddies prioritze lower in Perons, and ensures the UI is notified of changes in mobileness. Other protocols to follow.
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
344 | |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
345 | static void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
346 | do_protocol_change_account_status(PurpleAccount *account, |
| 15884 | 347 | PurpleStatus *old_status, PurpleStatus *new_status) |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
348 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
349 | PurpleProtocol *protocol; |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
350 | |
| 15884 | 351 | if (purple_status_is_online(new_status) && |
|
24519
d4af3d043211
Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents:
23875
diff
changeset
|
352 | purple_account_is_disconnected(account) && |
|
d4af3d043211
Improve our NetworkManager support in a couple of ways:
Richard Laager <rlaager@pidgin.im>
parents:
23875
diff
changeset
|
353 | purple_network_is_available()) |
|
11718
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
11628
diff
changeset
|
354 | { |
| 15884 | 355 | purple_account_connect(account); |
|
11718
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
11628
diff
changeset
|
356 | return; |
|
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
11628
diff
changeset
|
357 | } |
|
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
11628
diff
changeset
|
358 | |
| 15884 | 359 | if (!purple_status_is_online(new_status)) |
|
14224
d6d41ff969df
[gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14097
diff
changeset
|
360 | { |
| 15884 | 361 | if (!purple_account_is_disconnected(account)) |
| 362 | purple_account_disconnect(account); | |
|
34146
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34029
diff
changeset
|
363 | /* Clear out the unsaved password if we switch to offline status */ |
|
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34029
diff
changeset
|
364 | if (!purple_account_get_remember_password(account)) |
|
99bad5c80d1e
More password wiping, better password management withing account.c, using actual UI name with KWallet
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34029
diff
changeset
|
365 | purple_account_set_password(account, NULL, NULL, NULL); |
|
34019
bc87f596bb4c
compile, appears to work too.
Ka-Hing Cheung <khc@pidgin.im>
parents:
34018
diff
changeset
|
366 | |
|
14224
d6d41ff969df
[gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14097
diff
changeset
|
367 | return; |
|
d6d41ff969df
[gaim-migrate @ 16810]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14097
diff
changeset
|
368 | } |
|
11718
90804d019837
[gaim-migrate @ 14009]
Mark Doliner <markdoliner@pidgin.im>
parents:
11628
diff
changeset
|
369 | |
| 15884 | 370 | if (purple_account_is_connecting(account)) |
|
12108
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
371 | /* |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
372 | * We don't need to call the set_status PRPL function because |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
373 | * the PRPL will take care of setting its status during the |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
374 | * connection process. |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
375 | */ |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
376 | return; |
|
a74fd0d6b79c
[gaim-migrate @ 14408]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11948
diff
changeset
|
377 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
378 | protocol = purple_find_protocol_info(purple_account_get_protocol_id(account)); |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
379 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
380 | if (protocol == NULL) |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
381 | return; |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
382 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
383 | if (!purple_account_is_disconnected(account) && protocol->set_status != NULL) |
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11257
diff
changeset
|
384 | { |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36571
diff
changeset
|
385 | purple_protocol_iface_set_status(protocol, account, new_status); |
|
11628
cdd5df7cfbc1
[gaim-migrate @ 13903]
Casey Harkins <charkins@pidgin.im>
parents:
11257
diff
changeset
|
386 | } |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
387 | } |
|
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
388 | |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
389 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
390 | purple_protocol_change_account_status(PurpleAccount *account, |
| 15884 | 391 | PurpleStatus *old_status, PurpleStatus *new_status) |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
392 | { |
|
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
393 | g_return_if_fail(account != NULL); |
|
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
394 | g_return_if_fail(new_status != NULL); |
|
21720
235394d5c7f4
Pull a bunch of bugfix only changes to im.pidgin.pidgin.2.3.1,
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
20115
diff
changeset
|
395 | g_return_if_fail(!purple_status_is_exclusive(new_status) || old_status != NULL); |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
396 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
397 | do_protocol_change_account_status(account, old_status, new_status); |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
398 | |
| 15884 | 399 | purple_signal_emit(purple_accounts_get_handle(), "account-status-changed", |
|
12304
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
400 | account, old_status, new_status); |
|
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
401 | } |
|
e849bc5e8d5d
[gaim-migrate @ 14608]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12176
diff
changeset
|
402 | |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
403 | GList * |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
404 | purple_protocol_get_statuses(PurpleAccount *account, PurplePresence *presence) |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
405 | { |
|
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
406 | GList *statuses = NULL; |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18177
diff
changeset
|
407 | GList *l; |
| 15884 | 408 | PurpleStatus *status; |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
409 | |
|
10447
887380ec66f5
[gaim-migrate @ 11712]
Mark Doliner <markdoliner@pidgin.im>
parents:
10052
diff
changeset
|
410 | g_return_val_if_fail(account != NULL, NULL); |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
411 | g_return_val_if_fail(presence != NULL, NULL); |
|
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
412 | |
| 15884 | 413 | for (l = purple_account_get_status_types(account); l != NULL; l = l->next) |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
414 | { |
| 15884 | 415 | status = purple_status_new((PurpleStatusType *)l->data, presence); |
|
15657
a9e38c097d28
sf patch #1655057, from Peter Tang
Mark Doliner <markdoliner@pidgin.im>
parents:
15588
diff
changeset
|
416 | statuses = g_list_prepend(statuses, status); |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
417 | } |
|
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
418 | |
|
15657
a9e38c097d28
sf patch #1655057, from Peter Tang
Mark Doliner <markdoliner@pidgin.im>
parents:
15588
diff
changeset
|
419 | statuses = g_list_reverse(statuses); |
|
11730
649c38d2a8ab
[gaim-migrate @ 14021]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
11718
diff
changeset
|
420 | |
|
10006
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
421 | return statuses; |
|
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
422 | } |
|
800a81666868
[gaim-migrate @ 10923]
Dave West <kat@users.sourceforge.net>
parents:
9949
diff
changeset
|
423 | |
|
29487
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
424 | static void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
425 | purple_protocol_attention(PurpleConversation *conv, const char *who, |
|
29487
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
426 | guint type, PurpleMessageFlags flags, time_t mtime) |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
427 | { |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
428 | PurpleAccount *account = purple_conversation_get_account(conv); |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
429 | purple_signal_emit(purple_conversations_get_handle(), |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
430 | flags == PURPLE_MESSAGE_SEND ? "sent-attention" : "got-attention", |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
431 | account, who, conv, type); |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
432 | } |
|
1fa2077fb506
Remove purple_conversation_attention (also let prpl_send_attention handle
Marcus Lundblad <malu@pidgin.im>
parents:
29486
diff
changeset
|
433 | |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
434 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
435 | purple_protocol_send_attention(PurpleConnection *gc, const char *who, guint type_code) |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
436 | { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
437 | PurpleAttentionType *attn; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
438 | PurpleMessageFlags flags; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
439 | PurpleProtocol *protocol; |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
440 | PurpleIMConversation *im; |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
441 | gboolean (*send_attention)(PurpleConnection *, const char *, guint); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
442 | PurpleBuddy *buddy; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
443 | const char *alias; |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
444 | gchar *description; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
445 | time_t mtime; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
446 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
447 | g_return_if_fail(gc != NULL); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
448 | g_return_if_fail(who != NULL); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
449 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
450 | protocol = purple_find_protocol_info(purple_account_get_protocol_id(purple_connection_get_account(gc))); |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
451 | send_attention = protocol->send_attention; |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
452 | g_return_if_fail(send_attention != NULL); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
453 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
454 | mtime = time(NULL); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
455 | |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32554
diff
changeset
|
456 | attn = purple_get_attention_type_from_code(purple_connection_get_account(gc), type_code); |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
457 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
458 | if ((buddy = purple_blist_find_buddy(purple_connection_get_account(gc), who)) != NULL) |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
459 | alias = purple_buddy_get_contact_alias(buddy); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
460 | else |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
461 | alias = who; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
462 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
463 | if (attn && purple_attention_type_get_outgoing_desc(attn)) { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
464 | description = g_strdup_printf(purple_attention_type_get_outgoing_desc(attn), alias); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
465 | } else { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
466 | description = g_strdup_printf(_("Requesting %s's attention..."), alias); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
467 | } |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
468 | |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
469 | flags = PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_SYSTEM; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
470 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
471 | purple_debug_info("server", "serv_send_attention: sending '%s' to %s\n", |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
472 | description, who); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
473 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
474 | if (!send_attention(gc, who, type_code)) |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
475 | return; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
476 | |
|
34656
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
477 | im = purple_im_conversation_new(purple_connection_get_account(gc), who); |
|
adbcbe04077c
Refactored remaining libpurple to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
478 | purple_conversation_write_message(PURPLE_CONVERSATION(im), NULL, description, flags, mtime); |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
479 | purple_protocol_attention(PURPLE_CONVERSATION(im), who, type_code, PURPLE_MESSAGE_SEND, time(NULL)); |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
480 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
481 | g_free(description); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
482 | } |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
483 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
484 | static void |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
485 | got_attention(PurpleConnection *gc, int id, const char *who, guint type_code) |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
486 | { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
487 | PurpleMessageFlags flags; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
488 | PurpleAttentionType *attn; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
489 | PurpleBuddy *buddy; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
490 | const char *alias; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
491 | gchar *description; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
492 | time_t mtime; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
493 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
494 | mtime = time(NULL); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
495 | |
|
32678
01f6312a4a7b
On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents:
32554
diff
changeset
|
496 | attn = purple_get_attention_type_from_code(purple_connection_get_account(gc), type_code); |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
497 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
498 | /* PURPLE_MESSAGE_NOTIFY is for attention messages. */ |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
499 | flags = PURPLE_MESSAGE_SYSTEM | PURPLE_MESSAGE_NOTIFY | PURPLE_MESSAGE_RECV; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
500 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
501 | /* TODO: if (attn->icon_name) is non-null, use it to lookup an emoticon and display |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
502 | * it next to the attention command. And if it is null, display a generic icon. */ |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
503 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
504 | if ((buddy = purple_blist_find_buddy(purple_connection_get_account(gc), who)) != NULL) |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
505 | alias = purple_buddy_get_contact_alias(buddy); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
506 | else |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
507 | alias = who; |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
508 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
509 | if (attn && purple_attention_type_get_incoming_desc(attn)) { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
510 | description = g_strdup_printf(purple_attention_type_get_incoming_desc(attn), alias); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
511 | } else { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
512 | description = g_strdup_printf(_("%s has requested your attention!"), alias); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
513 | } |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
514 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
515 | purple_debug_info("server", "got_attention: got '%s' from %s\n", |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
516 | description, who); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
517 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
518 | if (id == -1) |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
519 | serv_got_im(gc, who, description, flags, mtime); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
520 | else |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
521 | serv_got_chat_in(gc, id, who, flags, description, mtime); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
522 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
523 | /* TODO: sounds (depending on PurpleAttentionType), shaking, etc. */ |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
524 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
525 | g_free(description); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
526 | } |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
527 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
528 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
529 | purple_protocol_got_attention(PurpleConnection *gc, const char *who, guint type_code) |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
530 | { |
|
29485
ee00ab964bcb
Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <malu@pidgin.im>
parents:
29483
diff
changeset
|
531 | PurpleConversation *conv = NULL; |
|
ee00ab964bcb
Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <malu@pidgin.im>
parents:
29483
diff
changeset
|
532 | PurpleAccount *account = purple_connection_get_account(gc); |
|
ee00ab964bcb
Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <malu@pidgin.im>
parents:
29483
diff
changeset
|
533 | |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
534 | got_attention(gc, -1, who, type_code); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29670
diff
changeset
|
535 | conv = |
|
34625
03d62b1660fc
Refactor code to remove conversation type from some instances of purple_conversations_find_with_account()
Ankit Vani <a@nevitus.org>
parents:
34622
diff
changeset
|
536 | purple_conversations_find_with_account(who, account); |
|
29485
ee00ab964bcb
Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <malu@pidgin.im>
parents:
29483
diff
changeset
|
537 | if (conv) |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
538 | purple_protocol_attention(conv, who, type_code, PURPLE_MESSAGE_RECV, |
|
29485
ee00ab964bcb
Let _got_attention call _conversation_attention, instead of having prpls do it
Marcus Lundblad <malu@pidgin.im>
parents:
29483
diff
changeset
|
539 | time(NULL)); |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
540 | } |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
541 | |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
542 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
543 | purple_protocol_got_attention_in_chat(PurpleConnection *gc, int id, const char *who, guint type_code) |
|
23875
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
544 | { |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
545 | got_attention(gc, id, who, type_code); |
|
d7e5f66cbfc9
Add purple_prpl_got_attention_in_chat, then deprecate
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
22251
diff
changeset
|
546 | } |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
547 | |
|
26495
52846ebe1c7d
Don't assume a PurpleMedia instance will be created immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26482
diff
changeset
|
548 | gboolean |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
549 | purple_protocol_initiate_media(PurpleAccount *account, |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
550 | const char *who, |
|
26108
8d0fd2f195aa
Changed PurpleMediaStreamType to PurpleMediaSessionType.
Michael Ruprecht <maiku@pidgin.im>
parents:
26107
diff
changeset
|
551 | PurpleMediaSessionType type) |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
552 | { |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
553 | #ifdef USE_VV |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
554 | PurpleConnection *gc = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
555 | PurpleProtocol *protocol = NULL; |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
556 | |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
557 | if (account) |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
558 | gc = purple_account_get_connection(account); |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
559 | if (gc) |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
560 | protocol = purple_connection_get_protocol_info(gc); |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
561 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
562 | if (protocol && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(protocol, initiate_media)) { |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
563 | /* should check that the protocol supports this media type here? */ |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36571
diff
changeset
|
564 | return purple_protocol_iface_initiate_media(protocol, account, who, type); |
|
26495
52846ebe1c7d
Don't assume a PurpleMedia instance will be created immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26482
diff
changeset
|
565 | } else |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
566 | #endif |
|
26495
52846ebe1c7d
Don't assume a PurpleMedia instance will be created immediately.
Michael Ruprecht <maiku@pidgin.im>
parents:
26482
diff
changeset
|
567 | return FALSE; |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
568 | } |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
569 | |
|
26316
950c0d491c0d
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26260
diff
changeset
|
570 | PurpleMediaCaps |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
571 | purple_protocol_get_media_caps(PurpleAccount *account, const char *who) |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
572 | { |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
573 | #ifdef USE_VV |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
574 | PurpleConnection *gc = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
575 | PurpleProtocol *protocol = NULL; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29670
diff
changeset
|
576 | |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
577 | if (account) |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
578 | gc = purple_account_get_connection(account); |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
579 | if (gc) |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
580 | protocol = purple_connection_get_protocol_info(gc); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29670
diff
changeset
|
581 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
582 | if (protocol && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(protocol, |
|
26316
950c0d491c0d
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26260
diff
changeset
|
583 | get_media_caps)) { |
|
36606
9fe2d65fe1a7
Use the purple_protocol_iface_* API instead of protocol->function()
Ankit Vani <a@nevitus.org>
parents:
36571
diff
changeset
|
584 | return purple_protocol_iface_get_media_caps(protocol, account, who); |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
585 | } |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
586 | #endif |
|
26316
950c0d491c0d
Change purple_prpl_can_do_media to purple_prpl_get_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
26260
diff
changeset
|
587 | return PURPLE_MEDIA_CAPS_NONE; |
|
26099
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
588 | } |
|
2ba28e840a95
Convert serv_* media functions to purple_prpl_* functions.
Michael Ruprecht <maiku@pidgin.im>
parents:
22251
diff
changeset
|
589 | |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
590 | void |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
591 | purple_protocol_got_media_caps(PurpleAccount *account, const char *name) |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
592 | { |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
593 | #ifdef USE_VV |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
594 | GSList *list; |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
595 | |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
596 | g_return_if_fail(account != NULL); |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
597 | g_return_if_fail(name != NULL); |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
598 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34656
diff
changeset
|
599 | if ((list = purple_blist_find_buddies(account, name)) == NULL) |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
600 | return; |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
601 | |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
602 | while (list) { |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
603 | PurpleBuddy *buddy = list->data; |
|
29670
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
604 | PurpleMediaCaps oldcaps = purple_buddy_get_media_caps(buddy); |
|
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
605 | PurpleMediaCaps newcaps = 0; |
|
29547
debae7802d68
Essentially normalize the username passed to purple_prpl_got_media_caps.
Michael Ruprecht <maiku@pidgin.im>
parents:
29546
diff
changeset
|
606 | const gchar *bname = purple_buddy_get_name(buddy); |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
607 | list = g_slist_delete_link(list, list); |
|
29546
5858906c0f7b
Add media_caps to PurpleBuddy structure and use it to determine the old caps
Michael Ruprecht <maiku@pidgin.im>
parents:
29544
diff
changeset
|
608 | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
29670
diff
changeset
|
609 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
610 | newcaps = purple_protocol_get_media_caps(account, bname); |
|
29670
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
611 | purple_buddy_set_media_caps(buddy, newcaps); |
|
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
612 | |
|
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
613 | if (oldcaps == newcaps) |
|
29546
5858906c0f7b
Add media_caps to PurpleBuddy structure and use it to determine the old caps
Michael Ruprecht <maiku@pidgin.im>
parents:
29544
diff
changeset
|
614 | continue; |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
615 | |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
616 | purple_signal_emit(purple_blist_get_handle(), |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
617 | "buddy-caps-changed", buddy, |
|
29670
c1d3cb9db1d7
update prpl.c to use the new purple_buddy_[gs]et_media_caps api
Gary Kramlich <grim@reaperworld.com>
parents:
29653
diff
changeset
|
618 | newcaps, oldcaps); |
|
29543
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
619 | } |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
620 | #endif |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
621 | } |
|
4e38799c741e
Add the purple_media_got_media_caps function in order to signal when a prpl
Michael Ruprecht <maiku@pidgin.im>
parents:
27786
diff
changeset
|
622 | |
|
36487
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
623 | PurpleProtocolAction * |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
624 | purple_protocol_action_new(const char* label, |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
625 | PurpleProtocolActionCallback callback) |
|
36388
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
626 | { |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
627 | PurpleProtocolAction *action; |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
628 | |
|
36488
48c3419844f0
Undo action-related changes in UI
Ankit Vani <a@nevitus.org>
parents:
36487
diff
changeset
|
629 | g_return_val_if_fail(label != NULL && callback != NULL, NULL); |
|
36388
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
630 | |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
631 | action = g_new0(PurpleProtocolAction, 1); |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
632 | |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
633 | action->label = g_strdup(label); |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
634 | action->callback = callback; |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
635 | |
|
36487
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
636 | return action; |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
637 | } |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
638 | |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
639 | void |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
640 | purple_protocol_action_free(PurpleProtocolAction *action) |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
641 | { |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
642 | g_return_if_fail(action != NULL); |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
643 | |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
644 | g_free(action->label); |
|
725e37471387
Make actions a callback again, so that a plugin/protocol can change them
Ankit Vani <a@nevitus.org>
parents:
36465
diff
changeset
|
645 | g_free(action); |
|
36388
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
646 | } |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
647 | |
|
207c2716f0a8
Added struct PurpleProtocolAction, and purple_protocol_actions_add().
Ankit Vani <a@nevitus.org>
parents:
36378
diff
changeset
|
648 | /************************************************************************** |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
649 | * Protocols API |
|
9949
377cd65fab3d
[gaim-migrate @ 10845]
Daniel Atallah <datallah@pidgin.im>
parents:
9460
diff
changeset
|
650 | **************************************************************************/ |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
651 | static void |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
652 | purple_protocol_destroy(PurpleProtocol *protocol) |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
653 | { |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
654 | GList *accounts, *l; |
| 981 | 655 | |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
656 | accounts = purple_accounts_get_all_active(); |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
657 | for (l = accounts; l != NULL; l = l->next) { |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
658 | PurpleAccount *account = PURPLE_ACCOUNT(l->data); |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
659 | if (purple_account_is_disconnected(account)) |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
660 | continue; |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
661 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
662 | if (purple_strequal(protocol->id, purple_account_get_protocol_id(account))) |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
663 | purple_account_disconnect(account); |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
664 | } |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
665 | |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
666 | g_list_free(accounts); |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
667 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
668 | while (protocol->user_splits) { |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
669 | PurpleAccountUserSplit *split = protocol->user_splits->data; |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
670 | purple_account_user_split_destroy(split); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
671 | protocol->user_splits = g_list_delete_link(protocol->user_splits, |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
672 | protocol->user_splits); |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
673 | } |
|
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
674 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
675 | while (protocol->protocol_options) { |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
676 | PurpleAccountOption *option = protocol->protocol_options->data; |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
677 | purple_account_option_destroy(option); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
678 | protocol->protocol_options = |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
679 | g_list_delete_link(protocol->protocol_options, |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
680 | protocol->protocol_options); |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
681 | } |
|
36519
8afeafb200c1
Cancel pending dialogs and disconnect signals when removing a protocol
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
682 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
683 | purple_request_close_with_handle(protocol); |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
684 | purple_notify_close_with_handle(protocol); |
|
36519
8afeafb200c1
Cancel pending dialogs and disconnect signals when removing a protocol
Ankit Vani <a@nevitus.org>
parents:
36488
diff
changeset
|
685 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
686 | purple_signals_disconnect_by_handle(protocol); |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
687 | purple_signals_unregister_by_instance(protocol); |
|
36527
016e4be6f3da
Unregister signals on plugin unload and protocol removal
Ankit Vani <a@nevitus.org>
parents:
36519
diff
changeset
|
688 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
689 | purple_prefs_disconnect_by_handle(protocol); |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
690 | |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
691 | g_object_unref(protocol); |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
692 | } |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
693 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
694 | PurpleProtocol * |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
695 | purple_find_protocol_info(const char *id) |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
696 | { |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
697 | return g_hash_table_lookup(protocols, id); |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
698 | } |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
699 | |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
700 | PurpleProtocol * |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
701 | purple_protocols_add(GType protocol_type) |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
702 | { |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
703 | PurpleProtocol *protocol = g_object_new(protocol_type, NULL); |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
704 | if (purple_find_protocol_info(purple_protocol_get_id(protocol))) { |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
705 | g_object_unref(protocol); |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
706 | return NULL; |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
707 | } |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
708 | |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
709 | g_hash_table_insert(protocols, g_strdup(purple_protocol_get_id(protocol)), |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
710 | protocol); |
|
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
711 | return protocol; |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
712 | } |
|
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
713 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
714 | gboolean purple_protocols_remove(PurpleProtocol *protocol) |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
715 | { |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
716 | if (purple_find_protocol_info(purple_protocol_get_id(protocol)) == NULL) |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
717 | return FALSE; |
|
36455
27fb01531390
Destroy options, splits and actions when a protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36396
diff
changeset
|
718 | |
|
36571
89f3e5748a68
Changed signature of purple_protocols_add() take a GType and return the PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36559
diff
changeset
|
719 | g_hash_table_remove(protocols, purple_protocol_get_id(protocol)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
720 | purple_protocol_destroy(protocol); |
|
36462
869de290ccfb
Disconnect all accounts of a protocol when the protocol is removed
Ankit Vani <a@nevitus.org>
parents:
36455
diff
changeset
|
721 | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
722 | return TRUE; |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
723 | } |
|
10036
743f585a1141
[gaim-migrate @ 10995]
Luke Schierer <lschiere@pidgin.im>
parents:
10023
diff
changeset
|
724 | |
|
36378
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
725 | GList * |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
726 | purple_protocols_get_all(void) |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
727 | { |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
728 | GList *ret = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
729 | PurpleProtocol *protocol; |
|
36378
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
730 | GHashTableIter iter; |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
731 | |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
732 | g_hash_table_iter_init(&iter, protocols); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
733 | while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&protocol)) |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
734 | ret = g_list_append(ret, protocol); |
|
36378
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
735 | |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
736 | return ret; |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
737 | } |
|
d51a8507f4e0
Added purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36375
diff
changeset
|
738 | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
739 | /************************************************************************** |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
740 | * Protocols Subsystem API |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
741 | **************************************************************************/ |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
742 | void |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
743 | purple_protocols_init(void) |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
744 | { |
| 36465 | 745 | protocols = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, |
| 746 | (GDestroyNotify)purple_protocol_destroy); | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
747 | } |
|
5205
242b8aa81328
[gaim-migrate @ 5573]
Christian Hammond <chipx86@chipx86.com>
parents:
5161
diff
changeset
|
748 | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
749 | void * |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
750 | purple_protocols_get_handle(void) |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
751 | { |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
752 | static int handle; |
| 981 | 753 | |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
754 | return &handle; |
| 981 | 755 | } |
|
36375
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
756 | |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
757 | void |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
758 | purple_protocols_uninit(void) |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
759 | { |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
760 | g_hash_table_destroy(protocols); |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
761 | } |
|
8ed701a7333e
Added a protocols subsystem API and a protocols API to add/remove protocols.
Ankit Vani <a@nevitus.org>
parents:
36362
diff
changeset
|
762 |