annotate src/protocols/bonjour/buddy.c @ 11796:b9b7a010b043

[gaim-migrate @ 14087] I need to sleep. This isn't finished. Hopefully someone will finish it before I wake up. Moved Preferences > Buddy List to Buddies menu. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 24 Oct 2005 08:06:34 +0000
parents 5a2c38d33eb4
children b10030f6eab7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
1 /*
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
2 * This program is free software; you can redistribute it and/or modify
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
3 * it under the terms of the GNU General Public License as published by
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
4 * the Free Software Foundation; either version 2 of the License, or
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
5 * (at your option) any later version.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
6 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
7 * This program is distributed in the hope that it will be useful,
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
10 * GNU Library General Public License for more details.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
11 *
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
12 * You should have received a copy of the GNU General Public License
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
13 * along with this program; if not, write to the Free Software
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
15 */
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
16
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
17 #include <glib.h>
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
18 #include <stdlib.h>
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
19
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
20 #include "buddy.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
21 #include "account.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
22 #include "blist.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
23 #include "bonjour.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
24 #include "debug.h"
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
25
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
26 /**
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
27 * Creates a new buddy.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
28 */
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
29 BonjourBuddy *
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
30 bonjour_buddy_new(gchar *name, gchar *first, gint port_p2pj,
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
31 gchar *phsh, gchar *status, gchar *email, gchar *last, gchar *jid, gchar *AIM,
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
32 gchar *vc, gchar *ip, gchar *msg)
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
33 {
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
34 BonjourBuddy *buddy = malloc(sizeof(BonjourBuddy));
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
35
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
36 buddy->name = g_strdup(name);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
37 buddy->first = g_strdup(first);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
38 buddy->port_p2pj = port_p2pj;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
39 buddy->phsh = g_strdup(phsh);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
40 buddy->status = g_strdup(status);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
41 buddy->email = g_strdup(email);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
42 buddy->last = g_strdup(last);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
43 buddy->jid = g_strdup(jid);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
44 buddy->AIM = g_strdup(AIM);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
45 buddy->vc = g_strdup(vc);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
46 buddy->ip = g_strdup(ip);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
47 buddy->msg = g_strdup(msg);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
48 buddy->conversation = NULL;
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
49
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
50 return buddy;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
51 }
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
52
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
53 /**
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
54 * Check if all the compulsory buddy data is present.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
55 */
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
56 gboolean
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
57 bonjour_buddy_check(BonjourBuddy *buddy)
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
58 {
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
59 if (buddy->name == NULL) {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
60 return FALSE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
61 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
62
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
63 if (buddy->first == NULL) {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
64 return FALSE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
65 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
66
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
67 if (buddy->last == NULL) {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
68 return FALSE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
69 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
70
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
71 if (buddy->port_p2pj == -1) {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
72 return FALSE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
73 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
74
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
75 if (buddy->status == NULL) {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
76 return FALSE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
77 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
78
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
79 return TRUE;
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
80 }
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
81
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
82 /**
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
83 * If the buddy does not yet exist, then create it and add it to
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
84 * our buddy list. In either case we set the correct status for
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
85 * the buddy.
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
86 */
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
87 void
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
88 bonjour_buddy_add_to_gaim(GaimAccount *account, BonjourBuddy *bonjour_buddy)
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
89 {
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
90 GaimBuddy *buddy;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
91 GaimGroup *group;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
92 const char *status_id, *first, *last;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
93 char *alias;
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
94
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
95 /* Translate between the Bonjour status and the Gaim status */
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
96 if (g_ascii_strcasecmp("dnd", bonjour_buddy->status) == 0)
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
97 status_id = BONJOUR_STATUS_ID_AWAY;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
98 else
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
99 status_id = BONJOUR_STATUS_ID_AVAILABLE;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
100
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
101 /*
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
102 * TODO: Figure out the idle time by getting the "away"
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
103 * field from the DNS SD.
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
104 */
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
105
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
106 /* Create the alias for the buddy using the first and the last name */
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
107 first = bonjour_buddy->first;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
108 last = bonjour_buddy->last;
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
109 alias = g_strdup_printf("%s%s%s",
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
110 (first && *first ? first : ""),
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
111 (first && *first && last && *last ? " " : ""),
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
112 (last && *last ? last : ""));
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
113
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
114 /* Make sure the Bonjour group exists in our buddy list */
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
115 group = gaim_find_group(BONJOUR_GROUP_NAME); /* Use the buddy's domain, instead? */
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
116 if (group == NULL)
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
117 {
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
118 group = gaim_group_new(BONJOUR_GROUP_NAME);
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
119 gaim_blist_add_group(group, NULL);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
120 }
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
121
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
122 /* Make sure the buddy exists in our buddy list */
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
123 buddy = gaim_find_buddy(account, bonjour_buddy->name);
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
124 if (buddy == NULL)
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
125 {
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
126 buddy = gaim_buddy_new(account, bonjour_buddy->name, alias);
11519
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
127 buddy->proto_data = bonjour_buddy;
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
128 gaim_blist_node_set_flags((GaimBlistNode *)buddy, GAIM_BLIST_NODE_FLAG_NO_SAVE);
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
129 gaim_blist_add_buddy(buddy, NULL, group, NULL);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
130 }
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
131
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
132 /* Set the user's status */
11519
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
133 if (bonjour_buddy->msg != NULL)
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
134 gaim_prpl_got_user_status(account, buddy->name, status_id,
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
135 "message", bonjour_buddy->msg,
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
136 NULL);
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
137 else
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
138 gaim_prpl_got_user_status(account, buddy->name, status_id,
0dfda214df89 [gaim-migrate @ 13764]
Mark Doliner <mark@kingant.net>
parents: 11496
diff changeset
139 NULL);
11496
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
140 gaim_prpl_got_user_idle(account, buddy->name, FALSE, 0);
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
141
3f038da50a18 [gaim-migrate @ 13740]
Mark Doliner <mark@kingant.net>
parents: 11477
diff changeset
142 g_free(alias);
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
143 }
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
144
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
145 /**
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
146 * Deletes a buddy from memory.
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
147 */
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
148 void
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
149 bonjour_buddy_delete(BonjourBuddy *buddy)
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
150 {
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
151 g_free(buddy->name);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
152 g_free(buddy->first);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
153 g_free(buddy->phsh);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
154 g_free(buddy->status);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
155 g_free(buddy->email);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
156 g_free(buddy->last);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
157 g_free(buddy->jid);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
158 g_free(buddy->AIM);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
159 g_free(buddy->vc);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
160 g_free(buddy->ip);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
161 g_free(buddy->msg);
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
162
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
163 if (buddy->conversation != NULL)
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
164 {
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
165 g_free(buddy->conversation->buddy_name);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
166 g_free(buddy->conversation);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
167 }
11539
5a2c38d33eb4 [gaim-migrate @ 13794]
Mark Doliner <mark@kingant.net>
parents: 11519
diff changeset
168
11477
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
169 free(buddy);
36f575351c49 [gaim-migrate @ 13719]
Mark Doliner <mark@kingant.net>
parents:
diff changeset
170 }