comparison libpurple/protocols/msn/userlist.c @ 26991:2a95e8bd9b80

Parse the invite message out of the pending membership list so that it can be presented to the user when someone adds us to their buddy list.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 19 May 2009 03:16:45 +0000
parents 10941ac443e1
children 1fcd09c34fee
comparison
equal deleted inserted replaced
26990:16255111b180 26991:2a95e8bd9b80
84 g_free(pa->friendly); 84 g_free(pa->friendly);
85 g_free(pa); 85 g_free(pa);
86 } 86 }
87 87
88 static void 88 static void
89 got_new_entry(PurpleConnection *gc, const char *passport, const char *friendly) 89 got_new_entry(PurpleConnection *gc, const char *passport, const char *friendly, const char *message)
90 { 90 {
91 PurpleAccount *acct; 91 PurpleAccount *acct;
92 MsnPermitAdd *pa; 92 MsnPermitAdd *pa;
93 93
94 pa = g_new0(MsnPermitAdd, 1); 94 pa = g_new0(MsnPermitAdd, 1);
95 pa->who = g_strdup(passport); 95 pa->who = g_strdup(passport);
96 pa->friendly = g_strdup(friendly); 96 pa->friendly = g_strdup(friendly);
97 pa->gc = gc; 97 pa->gc = gc;
98 98
99 acct = purple_connection_get_account(gc); 99 acct = purple_connection_get_account(gc);
100 purple_account_request_authorization(acct, passport, NULL, friendly, NULL, 100 purple_account_request_authorization(acct, passport, NULL, friendly, message,
101 purple_find_buddy(acct, passport) != NULL, 101 purple_find_buddy(acct, passport) != NULL,
102 msn_accept_add_cb, msn_cancel_add_cb, pa); 102 msn_accept_add_cb, msn_cancel_add_cb, pa);
103 103
104 } 104 }
105 105
148 { 148 {
149 PurpleConnection *gc; 149 PurpleConnection *gc;
150 PurpleAccount *account; 150 PurpleAccount *account;
151 const char *passport; 151 const char *passport;
152 const char *store; 152 const char *store;
153 const char *message;
153 154
154 account = session->account; 155 account = session->account;
155 gc = purple_account_get_connection(account); 156 gc = purple_account_get_connection(account);
156 157
157 passport = msn_user_get_passport(user); 158 passport = msn_user_get_passport(user);
158 store = msn_user_get_friendly_name(user); 159 store = msn_user_get_friendly_name(user);
160 message = msn_user_get_invite_message(user);
159 161
160 msn_user_set_op(user, list_op); 162 msn_user_set_op(user, list_op);
161 163
162 if (list_op & MSN_LIST_FL_OP) 164 if (list_op & MSN_LIST_FL_OP)
163 { 165 {
197 * should use the friendly name, instead? --KingAnt 199 * should use the friendly name, instead? --KingAnt
198 */ 200 */
199 201
200 if (!(list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP))) 202 if (!(list_op & (MSN_LIST_AL_OP | MSN_LIST_BL_OP)))
201 { 203 {
202 /* got_new_entry(gc, passport, store); */ 204 /* got_new_entry(gc, passport, store, NULL); */
203 } 205 }
204 } 206 }
205 207
206 if (list_op & MSN_LIST_PL_OP) 208 if (list_op & MSN_LIST_PL_OP)
207 { 209 {
208 got_new_entry(gc, passport, store); 210 got_new_entry(gc, passport, store, message);
209 } 211 }
210 } 212 }
211 213
212 /************************************************************************** 214 /**************************************************************************
213 * UserList functions 215 * UserList functions