Wed, 08 Feb 2023 08:59:47 -0600
Export Account::error
I can't think of a good reason why we shouldn't expose the error property on
Accounts. But I would like to be able to set the error from the UI when there
is an error in the settings for example.
Testing Done:
Built the docs, ran the tests, used the prune connection action in the demo protocol plugin and verified everything was still working.
Reviewed at https://reviews.imfreedom.org/r/2216/
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
1 | /* |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
4 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
7 | * source distribution. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
8 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
12 | * (at your option) any later version. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
13 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
17 | * GNU General Public License for more details. |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
18 | * |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
21 | */ |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
22 | |
|
40870
e3397381fd35
Remove includes from protocol.h that weren't used there and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
23 | #include "buddy.h" |
|
e3397381fd35
Remove includes from protocol.h that weren't used there and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
24 | |
|
e3397381fd35
Remove includes from protocol.h that weren't used there and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
40804
diff
changeset
|
25 | #include "debug.h" |
|
40537
fbf29150c28c
Move PurpleAccountPresence and PurpleBuddyPresence to their own files
Gary Kramlich <grim@reaperworld.com>
parents:
40195
diff
changeset
|
26 | #include "purplebuddypresence.h" |
|
41771
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
27 | #include "purplecontactmanager.h" |
|
40992
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
28 | #include "purpleconversationmanager.h" |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
29 | #include "purpleprotocolclient.h" |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
30 | #include "util.h" |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
31 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
32 | typedef struct { |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
33 | gchar *id; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
34 | gchar *name; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
35 | gchar *local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
36 | gchar *server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
37 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
38 | gpointer proto_data; |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
39 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
40 | PurpleBuddyIcon *icon; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
41 | PurpleAccount *account; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
42 | PurplePresence *presence; |
|
35090
c181fdc1ceac
Make a few buddy, chat, group properties save data correctly on set_property after construction
Ankit Vani <a@nevitus.org>
parents:
35085
diff
changeset
|
43 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
44 | PurpleMediaCaps media_caps; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
45 | } PurpleBuddyPrivate; |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
46 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
47 | enum { |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
48 | PROP_0, |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
49 | PROP_ID, |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
50 | PROP_NAME, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
51 | PROP_LOCAL_ALIAS, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
52 | PROP_SERVER_ALIAS, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
53 | PROP_ICON, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
54 | PROP_ACCOUNT, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
55 | PROP_PRESENCE, |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
56 | PROP_MEDIA_CAPS, |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
57 | N_PROPERTIES |
| 34714 | 58 | }; |
| 59 | ||
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
60 | static GParamSpec *properties[N_PROPERTIES] = { NULL, }; |
|
35080
58bddd91956c
libpurple: use g_object_notify_by_pspec instead of g_object_notify
Ankit Vani <a@nevitus.org>
parents:
35066
diff
changeset
|
61 | |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
62 | G_DEFINE_TYPE_WITH_PRIVATE(PurpleBuddy, purple_buddy, PURPLE_TYPE_BLIST_NODE) |
|
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
63 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
64 | /****************************************************************************** |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
65 | * Helpers |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
66 | *****************************************************************************/ |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
67 | static void |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
68 | purple_buddy_set_id(PurpleBuddy *buddy, const gchar *id) { |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
69 | PurpleBuddyPrivate *priv = purple_buddy_get_instance_private(buddy); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
70 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
71 | g_free(priv->id); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
72 | priv->id = g_strdup(id); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
73 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
74 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_ID]); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
75 | } |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
76 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
77 | static void |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
78 | purple_buddy_set_account(PurpleBuddy *buddy, PurpleAccount *account) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
79 | PurpleBuddyPrivate *priv = purple_buddy_get_instance_private(buddy); |
|
35066
f997e5384f79
libpurple: Use G_PARAM_STATIC_STRINGS and ensure g_object_notify is always called
Ankit Vani <a@nevitus.org>
parents:
35058
diff
changeset
|
80 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
81 | if(g_set_object(&priv->account, account)) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
82 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_ACCOUNT]); |
|
34727
579e9a8dbd5f
Moved methods from buddylist.[ch] to the appropriate object files
Ankit Vani <a@nevitus.org>
parents:
34722
diff
changeset
|
83 | } |
|
34707
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
84 | } |
|
d433bf40792a
Added blistnode.[ch] and blistnodetypes.[ch]
Ankit Vani <a@nevitus.org>
parents:
diff
changeset
|
85 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
86 | /****************************************************************************** |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
87 | * GObject Implementation |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
88 | *****************************************************************************/ |
| 34714 | 89 | static void |
| 90 | purple_buddy_set_property(GObject *obj, guint param_id, const GValue *value, | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
91 | GParamSpec *pspec) |
| 34714 | 92 | { |
| 93 | PurpleBuddy *buddy = PURPLE_BUDDY(obj); | |
| 94 | ||
| 95 | switch (param_id) { | |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
96 | case PROP_ID: |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
97 | purple_buddy_set_id(buddy, g_value_get_string(value)); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
98 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
99 | case PROP_NAME: |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
100 | purple_buddy_set_name(buddy, g_value_get_string(value)); |
| 34714 | 101 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
102 | case PROP_LOCAL_ALIAS: |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
103 | purple_buddy_set_local_alias(buddy, g_value_get_string(value)); |
| 34714 | 104 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
105 | case PROP_SERVER_ALIAS: |
| 34714 | 106 | purple_buddy_set_server_alias(buddy, g_value_get_string(value)); |
| 107 | break; | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
108 | case PROP_ICON: |
|
34831
da607046d658
Backed out changeset d9b286af48ba
Ankit Vani <a@nevitus.org>
parents:
34830
diff
changeset
|
109 | purple_buddy_set_icon(buddy, g_value_get_pointer(value)); |
| 34714 | 110 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
111 | case PROP_ACCOUNT: |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
112 | purple_buddy_set_account(buddy, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
113 | PURPLE_ACCOUNT(g_value_get_object(value))); |
| 34714 | 114 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
115 | case PROP_MEDIA_CAPS: |
| 34714 | 116 | purple_buddy_set_media_caps(buddy, g_value_get_enum(value)); |
| 117 | break; | |
| 118 | default: | |
| 119 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); | |
| 120 | break; | |
| 121 | } | |
| 122 | } | |
| 123 | ||
| 124 | static void | |
| 125 | purple_buddy_get_property(GObject *obj, guint param_id, GValue *value, | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
126 | GParamSpec *pspec) |
| 34714 | 127 | { |
| 128 | PurpleBuddy *buddy = PURPLE_BUDDY(obj); | |
| 129 | ||
| 130 | switch (param_id) { | |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
131 | case PROP_ID: |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
132 | g_value_set_string(value, purple_buddy_get_id(buddy)); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
133 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
134 | case PROP_NAME: |
| 34714 | 135 | g_value_set_string(value, purple_buddy_get_name(buddy)); |
| 136 | break; | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
137 | case PROP_LOCAL_ALIAS: |
| 34714 | 138 | g_value_set_string(value, purple_buddy_get_local_alias(buddy)); |
| 139 | break; | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
140 | case PROP_SERVER_ALIAS: |
| 34714 | 141 | g_value_set_string(value, purple_buddy_get_server_alias(buddy)); |
| 142 | break; | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
143 | case PROP_ICON: |
|
34831
da607046d658
Backed out changeset d9b286af48ba
Ankit Vani <a@nevitus.org>
parents:
34830
diff
changeset
|
144 | g_value_set_pointer(value, purple_buddy_get_icon(buddy)); |
| 34714 | 145 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
146 | case PROP_ACCOUNT: |
| 34714 | 147 | g_value_set_object(value, purple_buddy_get_account(buddy)); |
| 148 | break; | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
149 | case PROP_PRESENCE: |
|
34836
289bc0df25bb
API changes for PurplePresence. See details.
Ankit Vani <a@nevitus.org>
parents:
34833
diff
changeset
|
150 | g_value_set_object(value, purple_buddy_get_presence(buddy)); |
| 34714 | 151 | break; |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
152 | case PROP_MEDIA_CAPS: |
| 34714 | 153 | g_value_set_enum(value, purple_buddy_get_media_caps(buddy)); |
| 154 | break; | |
| 155 | default: | |
| 156 | G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); | |
| 157 | break; | |
| 158 | } | |
| 159 | } | |
| 160 | ||
| 161 | static void | |
|
41960
c8a4853205e3
Bump C standard to C99 for libpurple files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41820
diff
changeset
|
162 | purple_buddy_init(G_GNUC_UNUSED PurpleBuddy *buddy) { |
|
34743
fccb496c385e
Override GObject constructed method for PurpleBuddy, PurpleChat and PurpleGroup, to inform UI of creation
Ankit Vani <a@nevitus.org>
parents:
34742
diff
changeset
|
163 | } |
|
fccb496c385e
Override GObject constructed method for PurpleBuddy, PurpleChat and PurpleGroup, to inform UI of creation
Ankit Vani <a@nevitus.org>
parents:
34742
diff
changeset
|
164 | |
|
fccb496c385e
Override GObject constructed method for PurpleBuddy, PurpleChat and PurpleGroup, to inform UI of creation
Ankit Vani <a@nevitus.org>
parents:
34742
diff
changeset
|
165 | static void |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
166 | purple_buddy_constructed(GObject *object) { |
|
34743
fccb496c385e
Override GObject constructed method for PurpleBuddy, PurpleChat and PurpleGroup, to inform UI of creation
Ankit Vani <a@nevitus.org>
parents:
34742
diff
changeset
|
167 | PurpleBuddy *buddy = PURPLE_BUDDY(object); |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
168 | PurpleBuddyPrivate *priv = purple_buddy_get_instance_private(buddy); |
| 34714 | 169 | |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
170 | G_OBJECT_CLASS(purple_buddy_parent_class)->constructed(object); |
|
34743
fccb496c385e
Override GObject constructed method for PurpleBuddy, PurpleChat and PurpleGroup, to inform UI of creation
Ankit Vani <a@nevitus.org>
parents:
34742
diff
changeset
|
171 | |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
172 | if(priv->id == NULL) { |
|
41820
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
173 | /* If there is no id for the user, generate a SHA256 based on the |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
174 | * account_id and the username. |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
175 | */ |
|
41976
49969fa9a664
Update libpurple for the deprecations in the account api
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
176 | PurpleContactInfo *info = PURPLE_CONTACT_INFO(priv->account); |
|
41820
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
177 | GChecksum *sum = g_checksum_new(G_CHECKSUM_SHA256); |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
178 | const guchar *data = NULL; |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
179 | |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
180 | data = (const guchar *)purple_account_get_protocol_id(priv->account); |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
181 | g_checksum_update(sum, data, -1); |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
182 | |
|
41976
49969fa9a664
Update libpurple for the deprecations in the account api
Gary Kramlich <grim@reaperworld.com>
parents:
41960
diff
changeset
|
183 | data = (const guchar *)purple_contact_info_get_username(info); |
|
41820
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
184 | g_checksum_update(sum, data, -1); |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
185 | |
|
41820
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
186 | data = (const guchar *)priv->name; |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
187 | g_checksum_update(sum, data, -1); |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
188 | |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
189 | purple_buddy_set_id(buddy, g_checksum_get_string(sum)); |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
190 | |
|
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
191 | g_checksum_free(sum); |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
192 | } |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
193 | |
|
34844
e341dbc04539
Refactored plugins, account, blistnodetypes to use the GObject presence API
Ankit Vani <a@nevitus.org>
parents:
34838
diff
changeset
|
194 | priv->presence = PURPLE_PRESENCE(purple_buddy_presence_new(buddy)); |
| 34714 | 195 | purple_presence_set_status_active(priv->presence, "offline", TRUE); |
| 196 | ||
|
39676
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
197 | purple_blist_new_node(purple_blist_get_default(), |
|
1e8394d47205
Add list parameter to all buddy list UI ops.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39675
diff
changeset
|
198 | PURPLE_BLIST_NODE(buddy)); |
| 34714 | 199 | } |
| 200 | ||
| 201 | static void | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
202 | purple_buddy_dispose(GObject *object) { |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
203 | PurpleBuddyPrivate *priv = purple_buddy_get_instance_private(PURPLE_BUDDY(object)); |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
204 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
205 | g_clear_pointer(&priv->icon, purple_buddy_icon_unref); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
206 | g_clear_object(&priv->presence); |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
207 | |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
208 | G_OBJECT_CLASS(purple_buddy_parent_class)->dispose(object); |
|
34986
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
209 | } |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
210 | |
|
894c29e33300
Move all object destruction code to finalize() methods and keep unrefs in dispose()
Ankit Vani <a@nevitus.org>
parents:
34983
diff
changeset
|
211 | static void |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
212 | purple_buddy_finalize(GObject *object) { |
| 34714 | 213 | PurpleBuddy *buddy = PURPLE_BUDDY(object); |
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
214 | PurpleBuddyPrivate *priv = purple_buddy_get_instance_private(buddy); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36365
diff
changeset
|
215 | PurpleProtocol *protocol; |
| 34714 | 216 | |
| 217 | /* | |
|
36637
9b0109ae118d
Renamed some prpl stuff to protocol stuff.
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
218 | * Tell the owner protocol that we're about to free the buddy so it |
| 34714 | 219 | * can free proto_data |
| 220 | */ | |
|
40804
5496016b3c00
Port libpurple from purple_protocols_ to purple_protocol_manager_
Gary Kramlich <grim@reaperworld.com>
parents:
40752
diff
changeset
|
221 | protocol = purple_account_get_protocol(priv->account); |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
222 | if(protocol) { |
|
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
223 | purple_protocol_client_buddy_free(PURPLE_PROTOCOL_CLIENT(protocol), |
|
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
224 | buddy); |
|
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40537
diff
changeset
|
225 | } |
| 34714 | 226 | |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
227 | g_free(priv->id); |
| 34714 | 228 | g_free(priv->name); |
| 229 | g_free(priv->local_alias); | |
| 230 | g_free(priv->server_alias); | |
| 231 | ||
|
39432
4c9808e30b3e
Use G_DEFINE_TYPE_WITH_PRIVATE on PurpleBuddy.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39352
diff
changeset
|
232 | G_OBJECT_CLASS(purple_buddy_parent_class)->finalize(object); |
| 34714 | 233 | } |
| 234 | ||
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
235 | static void purple_buddy_class_init(PurpleBuddyClass *klass) { |
| 34714 | 236 | GObjectClass *obj_class = G_OBJECT_CLASS(klass); |
| 237 | ||
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
238 | obj_class->constructed = purple_buddy_constructed; |
| 34714 | 239 | obj_class->dispose = purple_buddy_dispose; |
| 240 | obj_class->finalize = purple_buddy_finalize; | |
| 241 | obj_class->get_property = purple_buddy_get_property; | |
| 242 | obj_class->set_property = purple_buddy_set_property; | |
| 243 | ||
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
244 | /** |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
245 | * PurpleBuddy::id: |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
246 | * |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
247 | * A globally unique identifier for this specific buddy. |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
248 | * |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
249 | * If an id is not passed during instantiation a uuid4 string is set as the |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
250 | * id. |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
251 | * |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
252 | * Since: 3.0.0 |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
253 | */ |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
254 | properties[PROP_ID] = g_param_spec_string( |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
255 | "id", "id", |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
256 | "The globally unique identifier of the buddy.", |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
257 | NULL, |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
258 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
259 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
260 | properties[PROP_NAME] = g_param_spec_string( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
261 | "name", "Name", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
262 | "The name of the buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
263 | NULL, |
|
41820
19269097f706
Use a checksum for buddy ids when one isn't provided
Gary Kramlich <grim@reaperworld.com>
parents:
41771
diff
changeset
|
264 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS); |
| 34714 | 265 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
266 | properties[PROP_LOCAL_ALIAS] = g_param_spec_string( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
267 | "local-alias", "Local alias", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
268 | "Local alias of thee buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
269 | NULL, |
|
41309
f33f4713508b
Don't set some PurpleBuddy properties at construction time
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41302
diff
changeset
|
270 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 34714 | 271 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
272 | properties[PROP_SERVER_ALIAS] = g_param_spec_string( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
273 | "server-alias", "Server alias", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
274 | "Server-side alias of the buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
275 | NULL, |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
276 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 34714 | 277 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
278 | properties[PROP_ICON] = g_param_spec_pointer( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
279 | "icon", "Buddy icon", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
280 | "The icon for the buddy.", |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
281 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
282 | |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
283 | properties[PROP_ACCOUNT] = g_param_spec_object( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
284 | "account", "Account", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
285 | "The account for the buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
286 | PURPLE_TYPE_ACCOUNT, |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
287 | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); |
| 34714 | 288 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
289 | properties[PROP_PRESENCE] = g_param_spec_object( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
290 | "presence", "Presence", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
291 | "The status information for the buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
292 | PURPLE_TYPE_PRESENCE, |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
293 | G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); |
| 34714 | 294 | |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
295 | properties[PROP_MEDIA_CAPS] = g_param_spec_enum( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
296 | "media-caps", "Media capabilities", |
|
37948
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
297 | "The media capabilities of the buddy.", |
|
2a8f41535c8f
rename blistnodetypes.[ch] to buddy.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
37947
diff
changeset
|
298 | PURPLE_MEDIA_TYPE_CAPS, PURPLE_MEDIA_CAPS_NONE, |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
299 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); |
| 34714 | 300 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
301 | g_object_class_install_properties(obj_class, N_PROPERTIES, properties); |
| 34714 | 302 | } |
| 303 | ||
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
304 | /****************************************************************************** |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
305 | * Public API |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
306 | *****************************************************************************/ |
| 34714 | 307 | PurpleBuddy * |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
308 | purple_buddy_new(PurpleAccount *account, const gchar *name, const gchar *alias) |
| 34714 | 309 | { |
|
41771
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
310 | PurpleBuddy *buddy = NULL; |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
311 | PurpleContactManager *manager = NULL; |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
312 | |
|
34983
81638be26f41
Check types of GObjects instead of just for NULL values
Ankit Vani <a@nevitus.org>
parents:
34908
diff
changeset
|
313 | g_return_val_if_fail(PURPLE_IS_ACCOUNT(account), NULL); |
| 34714 | 314 | g_return_val_if_fail(name != NULL, NULL); |
| 315 | ||
|
41771
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
316 | buddy = g_object_new( |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
317 | PURPLE_TYPE_BUDDY, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
318 | "account", account, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
319 | "name", name, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
320 | "local-alias", alias, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
321 | NULL); |
|
41771
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
322 | |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
323 | manager = purple_contact_manager_get_default(); |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
324 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
325 | purple_contact_manager_add_buddy(manager, buddy); |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
326 | G_GNUC_END_IGNORE_DEPRECATIONS |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
327 | |
|
c5877e2c93f2
Create and add PurpleContacts to the manager when purple_buddy_new is called
Gary Kramlich <grim@reaperworld.com>
parents:
41733
diff
changeset
|
328 | return buddy; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
329 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
330 | |
|
41302
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
331 | const gchar * |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
332 | purple_buddy_get_id(PurpleBuddy *buddy) { |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
333 | PurpleBuddyPrivate *priv = NULL; |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
334 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
335 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
336 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
337 | priv = purple_buddy_get_instance_private(buddy); |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
338 | |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
339 | return priv->id; |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
340 | } |
|
d7d40a5d9533
Add an id property to PurpleBuddy
Gary Kramlich <grim@reaperworld.com>
parents:
40992
diff
changeset
|
341 | |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
342 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
343 | purple_buddy_set_icon(PurpleBuddy *buddy, PurpleBuddyIcon *icon) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
344 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
345 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
346 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
347 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
348 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
349 | if(priv->icon == icon) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
350 | return; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
351 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
352 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
353 | g_clear_pointer(&priv->icon, purple_buddy_icon_unref); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
354 | if(icon != NULL) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
355 | priv->icon = purple_buddy_icon_ref(icon); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
356 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
357 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
358 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_ICON]); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
359 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
360 | purple_signal_emit(purple_blist_get_handle(), "buddy-icon-changed", buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
361 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
362 | purple_blist_update_node(purple_blist_get_default(), |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
363 | PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
364 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
365 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
366 | PurpleBuddyIcon * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
367 | purple_buddy_get_icon(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
368 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
369 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
370 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
371 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
372 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
373 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
374 | return priv->icon; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
375 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
376 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
377 | PurpleAccount * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
378 | purple_buddy_get_account(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
379 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
380 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
381 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
382 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
383 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
384 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
385 | return priv->account; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
386 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
387 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
388 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
389 | purple_buddy_set_name(PurpleBuddy *buddy, const gchar *name) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
390 | PurpleBuddyList *blist = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
391 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
392 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
393 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
394 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
395 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
396 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
397 | if(priv->name != NULL) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
398 | purple_blist_update_buddies_cache(buddy, name); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
399 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
400 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
401 | g_free(priv->name); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
402 | priv->name = purple_utf8_strip_unprintables(name); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
403 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
404 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_NAME]); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
405 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
406 | blist = purple_blist_get_default(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
407 | purple_blist_save_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
408 | purple_blist_update_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
409 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
410 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
411 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
412 | purple_buddy_get_name(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
413 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
414 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
415 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
416 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
417 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
418 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
419 | return priv->name; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
420 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
421 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
422 | gpointer |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
423 | purple_buddy_get_protocol_data(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
424 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
425 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
426 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
427 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
428 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
429 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
430 | return priv->proto_data; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
431 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
432 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
433 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
434 | purple_buddy_set_protocol_data(PurpleBuddy *buddy, gpointer data) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
435 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
436 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
437 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
438 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
439 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
440 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
441 | priv->proto_data = data; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
442 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
443 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
444 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
445 | purple_buddy_get_alias_only(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
446 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
447 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
448 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
449 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
450 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
451 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
452 | if((priv->local_alias != NULL) && (*priv->local_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
453 | return priv->local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
454 | } else if((priv->server_alias != NULL) && (*priv->server_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
455 | return priv->server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
456 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
457 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
458 | return NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
459 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
460 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
461 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
462 | purple_buddy_get_contact_alias(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
463 | PurpleBuddyPrivate *priv = NULL; |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
464 | PurpleMetaContact *c = NULL; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
465 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
466 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
467 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
468 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
469 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
470 | /* Search for an alias for the buddy. In order of precedence: */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
471 | /* The local buddy alias */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
472 | if(priv->local_alias != NULL) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
473 | return priv->local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
474 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
475 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
476 | /* The contact alias */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
477 | c = purple_buddy_get_contact(buddy); |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
478 | if((c != NULL) && (purple_meta_contact_get_alias(c) != NULL)) { |
|
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
479 | return purple_meta_contact_get_alias(c); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
480 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
481 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
482 | /* The server alias */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
483 | if((priv->server_alias) && (*priv->server_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
484 | return priv->server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
485 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
486 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
487 | /* The buddy's user name (i.e. no alias) */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
488 | return priv->name; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
489 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
490 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
491 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
492 | purple_buddy_get_alias(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
493 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
494 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
495 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
496 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
497 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
498 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
499 | /* Search for an alias for the buddy. In order of precedence: */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
500 | /* The buddy alias */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
501 | if(priv->local_alias != NULL) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
502 | return priv->local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
503 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
504 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
505 | /* The server alias */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
506 | if((priv->server_alias) && (*priv->server_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
507 | return priv->server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
508 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
509 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
510 | /* The buddy's user name (i.e. no alias) */ |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
511 | return priv->name; |
| 34714 | 512 | } |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
513 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
514 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
515 | purple_buddy_set_local_alias(PurpleBuddy *buddy, const gchar *alias) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
516 | PurpleBuddyList *blist = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
517 | PurpleBuddyPrivate *priv = NULL; |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40870
diff
changeset
|
518 | PurpleConversation *im = NULL; |
|
40992
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
519 | PurpleConversationManager *manager = NULL; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
520 | gchar *old_alias = NULL, *new_alias = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
521 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
522 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
523 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
524 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
525 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
526 | if((alias != NULL) && (*alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
527 | new_alias = purple_utf8_strip_unprintables(alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
528 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
529 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
530 | if(purple_strequal(priv->local_alias, new_alias)) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
531 | g_free(new_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
532 | return; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
533 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
534 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
535 | old_alias = priv->local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
536 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
537 | if((new_alias != NULL) && (*new_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
538 | priv->local_alias = new_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
539 | } else { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
540 | priv->local_alias = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
541 | g_free(new_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
542 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
543 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
544 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_LOCAL_ALIAS]); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
545 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
546 | blist = purple_blist_get_default(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
547 | purple_blist_save_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
548 | purple_blist_update_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
549 | |
|
40992
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
550 | manager = purple_conversation_manager_get_default(); |
|
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
551 | im = purple_conversation_manager_find_im(manager, priv->account, |
|
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
552 | priv->name); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
553 | if(PURPLE_IS_IM_CONVERSATION(im)) { |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40870
diff
changeset
|
554 | purple_conversation_autoset_title(im); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
555 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
556 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
557 | purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased", buddy, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
558 | old_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
559 | g_free(old_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
560 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
561 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
562 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
563 | purple_buddy_get_local_alias(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
564 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
565 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
566 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
567 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
568 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
569 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
570 | return priv->local_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
571 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
572 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
573 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
574 | purple_buddy_set_server_alias(PurpleBuddy *buddy, const gchar *alias) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
575 | PurpleBuddyList *blist = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
576 | PurpleBuddyPrivate *priv = NULL; |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40870
diff
changeset
|
577 | PurpleConversation *im = NULL; |
|
40992
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
578 | PurpleConversationManager *manager = NULL; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
579 | gchar *old_alias = NULL, *new_alias = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
580 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
581 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
582 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
583 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
584 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
585 | if((alias != NULL) && (*alias != '\0') && g_utf8_validate(alias, -1, NULL)) |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
586 | { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
587 | new_alias = purple_utf8_strip_unprintables(alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
588 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
589 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
590 | if(purple_strequal(priv->server_alias, new_alias)) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
591 | g_free(new_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
592 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
593 | return; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
594 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
595 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
596 | old_alias = priv->server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
597 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
598 | if((new_alias != NULL) && (*new_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
599 | priv->server_alias = new_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
600 | } else { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
601 | priv->server_alias = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
602 | g_free(new_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
603 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
604 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
605 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_SERVER_ALIAS]); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
606 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
607 | blist = purple_blist_get_default(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
608 | purple_blist_save_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
609 | purple_blist_update_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
610 | |
|
40992
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
611 | manager = purple_conversation_manager_get_default(); |
|
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
612 | im = purple_conversation_manager_find_im(manager, priv->account, |
|
3a973a9c5a64
migrate libpurple to the ConversationManager API
Gary Kramlich <grim@reaperworld.com>
parents:
40885
diff
changeset
|
613 | priv->name); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
614 | if(PURPLE_IS_IM_CONVERSATION(im)) { |
|
40885
87f6241da196
Update purple_conversations_find_* to return PurpleConversations instead of subclasses
Gary Kramlich <grim@reaperworld.com>
parents:
40870
diff
changeset
|
615 | purple_conversation_autoset_title(im); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
616 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
617 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
618 | purple_signal_emit(purple_blist_get_handle(), "blist-node-aliased", buddy, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
619 | old_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
620 | g_free(old_alias); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
621 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
622 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
623 | const gchar * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
624 | purple_buddy_get_server_alias(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
625 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
626 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
627 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
628 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
629 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
630 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
631 | if((priv->server_alias) && (*priv->server_alias != '\0')) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
632 | return priv->server_alias; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
633 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
634 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
635 | return NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
636 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
637 | |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
638 | PurpleMetaContact * |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
639 | purple_buddy_get_contact(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
640 | PurpleBlistNode *parent = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
641 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
642 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
643 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
644 | parent = purple_blist_node_get_parent(PURPLE_BLIST_NODE(buddy)); |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
645 | if(PURPLE_IS_META_CONTACT(parent)) { |
|
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
646 | return PURPLE_META_CONTACT(parent); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
647 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
648 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
649 | return NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
650 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
651 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
652 | PurplePresence * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
653 | purple_buddy_get_presence(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
654 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
655 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
656 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
657 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
658 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
659 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
660 | return priv->presence; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
661 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
662 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
663 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
664 | purple_buddy_update_status(PurpleBuddy *buddy, PurpleStatus *old_status) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
665 | PurpleBuddyList *blist = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
666 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
667 | PurpleStatus *status = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
668 | gpointer handle = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
669 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
670 | gboolean old_online = FALSE, new_online = FALSE; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
671 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
672 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
673 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
674 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
675 | status = purple_presence_get_active_status(priv->presence); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
676 | blist = purple_blist_get_default(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
677 | handle = purple_blist_get_handle(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
678 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
679 | purple_debug_info("blistnodetypes", "Updating buddy status for %s (%s)\n", |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
680 | priv->name, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
681 | purple_account_get_protocol_name(priv->account)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
682 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
683 | old_online = purple_status_is_online(old_status); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
684 | new_online = purple_status_is_online(status); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
685 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
686 | if(old_online != new_online) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
687 | PurpleBlistNode *cnode = NULL, *gnode = NULL; |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
688 | PurpleMetaContact *contact = NULL; |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
689 | PurpleCountingNode *contact_counter = NULL, *group_counter = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
690 | gint delta = 0, limit = 0; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
691 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
692 | if(new_online) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
693 | purple_signal_emit(handle, "buddy-signed-on", buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
694 | delta = 1; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
695 | limit = 1; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
696 | } else { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
697 | purple_blist_node_set_int(PURPLE_BLIST_NODE(buddy), "last_seen", |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
698 | time(NULL)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
699 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
700 | purple_signal_emit(handle, "buddy-signed-off", buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
701 | delta = -1; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
702 | limit = 0; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
703 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
704 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
705 | cnode = purple_blist_node_get_parent(PURPLE_BLIST_NODE(buddy)); |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
706 | contact = PURPLE_META_CONTACT(cnode); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
707 | contact_counter = PURPLE_COUNTING_NODE(contact); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
708 | gnode = purple_blist_node_get_parent(cnode); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
709 | group_counter = PURPLE_COUNTING_NODE(gnode); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
710 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
711 | purple_counting_node_change_online_count(contact_counter, delta); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
712 | if(purple_counting_node_get_online_count(contact_counter) == limit) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
713 | purple_counting_node_change_online_count(group_counter, delta); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
714 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
715 | } else { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
716 | purple_signal_emit(handle, "buddy-status-changed", buddy, old_status, |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
717 | status); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
718 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
719 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
720 | /* |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
721 | * This function used to only call the following two functions if one of |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
722 | * the above signals had been triggered, but that's not good, because |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
723 | * if someone's away message changes and they don't go from away to back |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
724 | * to away then no signal is triggered. |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
725 | * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
726 | * It's a safe assumption that SOMETHING called this function. PROBABLY |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
727 | * because something, somewhere changed. Calling the stuff below |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
728 | * certainly won't hurt anything. Unless you're on a K6-2 300. |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
729 | */ |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
730 | purple_meta_contact_invalidate_priority_buddy(purple_buddy_get_contact(buddy)); |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
731 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
732 | purple_blist_update_node(blist, PURPLE_BLIST_NODE(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
733 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
734 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
735 | PurpleMediaCaps |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
736 | purple_buddy_get_media_caps(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
737 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
738 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
739 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), 0); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
740 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
741 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
742 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
743 | return priv->media_caps; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
744 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
745 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
746 | void |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
747 | purple_buddy_set_media_caps(PurpleBuddy *buddy, PurpleMediaCaps media_caps) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
748 | PurpleBuddyPrivate *priv = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
749 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
750 | g_return_if_fail(PURPLE_IS_BUDDY(buddy)); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
751 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
752 | priv = purple_buddy_get_instance_private(buddy); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
753 | priv->media_caps = media_caps; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
754 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
755 | g_object_notify_by_pspec(G_OBJECT(buddy), properties[PROP_MEDIA_CAPS]); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
756 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
757 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
758 | PurpleGroup * |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
759 | purple_buddy_get_group(PurpleBuddy *buddy) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
760 | PurpleBlistNode *contact = NULL, *group = NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
761 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
762 | g_return_val_if_fail(PURPLE_IS_BUDDY(buddy), NULL); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
763 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
764 | contact = purple_blist_node_get_parent(PURPLE_BLIST_NODE(buddy)); |
|
41733
a9085b52de8b
Rename PurpleContact to PurpleMetaContact.
Gary Kramlich <grim@reaperworld.com>
parents:
41685
diff
changeset
|
765 | if(!PURPLE_IS_META_CONTACT(contact)) { |
|
40752
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
766 | return purple_blist_get_default_group(); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
767 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
768 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
769 | group = purple_blist_node_get_parent(contact); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
770 | if(PURPLE_IS_GROUP(group)) { |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
771 | return PURPLE_GROUP(group); |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
772 | } |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
773 | |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
774 | return NULL; |
|
81e94476e3ac
Update buddy.c to more closely match our current gobject structure.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
775 | } |