Changeset 8e5e2e9
- Timestamp:
- 2006-09-24T19:25:06Z (18 years ago)
- Branches:
- master
- Children:
- 4ecdc69
- Parents:
- cfbb3a6
- Location:
- protocols/jabber
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
rcfbb3a6 r8e5e2e9 171 171 /* Just any whitespace character is enough as a keepalive for XMPP sessions. */ 172 172 jabber_write( gc, "\n", 1 ); 173 } 174 175 static void jabber_add_permit( struct gaim_connection *gc, char *who ) 176 { 177 presence_send_request( gc, who, "subscribed" ); 178 } 179 180 static void jabber_rem_permit( struct gaim_connection *gc, char *who ) 181 { 182 presence_send_request( gc, who, "unsubscribed" ); 183 } 184 185 static void jabber_add_deny( struct gaim_connection *gc, char *who ) 186 { 187 } 188 189 static void jabber_rem_deny( struct gaim_connection *gc, char *who ) 190 { 173 191 } 174 192 … … 194 212 // ret->chat_open = jabber_chat_open; 195 213 ret->keepalive = jabber_keepalive; 196 //ret->add_permit = jabber_add_permit;197 //ret->rem_permit = jabber_rem_permit;198 //ret->add_deny = jabber_add_deny;199 //ret->rem_deny = jabber_rem_deny;214 ret->add_permit = jabber_add_permit; 215 ret->rem_permit = jabber_rem_permit; 216 ret->add_deny = jabber_add_deny; 217 ret->rem_deny = jabber_rem_deny; 200 218 // ret->send_typing = jabber_send_typing; 201 219 ret->handle_cmp = g_strcasecmp; -
protocols/jabber/jabber.h
rcfbb3a6 r8e5e2e9 92 92 const struct jabber_away_state *jabber_away_state_by_code( char *code ); 93 93 const struct jabber_away_state *jabber_away_state_by_name( char *name ); 94 void jabber_buddy_ask( struct gaim_connection *gc, char *handle ); 94 95 95 96 extern const struct jabber_away_state jabber_away_state_list[]; -
protocols/jabber/jabber_util.c
rcfbb3a6 r8e5e2e9 149 149 return NULL; 150 150 } 151 152 struct jabber_buddy_ask_data 153 { 154 struct gaim_connection *gc; 155 char *handle; 156 char *realname; 157 }; 158 159 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla ) 160 { 161 presence_send_request( bla->gc, bla->handle, "subscribed" ); 162 163 if( find_buddy( bla->gc, bla->handle ) == NULL ) 164 show_got_added( bla->gc, bla->handle, NULL ); 165 166 g_free( bla->handle ); 167 g_free( bla ); 168 } 169 170 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla ) 171 { 172 presence_send_request( bla->gc, bla->handle, "subscribed" ); 173 174 g_free( bla->handle ); 175 g_free( bla ); 176 } 177 178 void jabber_buddy_ask( struct gaim_connection *gc, char *handle ) 179 { 180 struct jabber_buddy_ask_data *bla = g_new0( struct jabber_buddy_ask_data, 1 ); 181 char *buf; 182 183 bla->gc = gc; 184 bla->handle = g_strdup( handle ); 185 186 buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle ); 187 do_ask_dialog( gc, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no ); 188 } -
protocols/jabber/presence.c
rcfbb3a6 r8e5e2e9 42 42 else if( strcmp( type, "unavailable" ) == 0 ) 43 43 serv_got_update( gc, from, 0, 0, 0, 0, 0, 0 ); 44 else if( strcmp( type, "subscribe" ) == 0 ) 45 jabber_buddy_ask( gc, from ); 46 else if( strcmp( type, "subscribed" ) == 0 ) 47 serv_got_crap( gc, "%s just accepted your authorization request", from ); 48 else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 ) 49 { 50 /* Do nothing here. Plenty of control freaks or over-curious 51 souls get excited when they can see who still has them in 52 their buddy list and who finally removed them. Somehow I 53 got the impression that those are the people who get 54 removed from many buddy lists for "some" reason... 55 56 If you're one of those people, this is your chance to write 57 your first line of code in C... */ 58 } 44 59 else 45 60 {
Note: See TracChangeset
for help on using the changeset viewer.