Changeset 172a73f1
- Timestamp:
- 2006-09-24T10:25:41Z (18 years ago)
- Branches:
- master
- Children:
- 42127dc
- Parents:
- 5e202b0
- Location:
- protocols/jabber
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
r5e202b0 r172a73f1 152 152 jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL; 153 153 154 presence_send ( gc, NULL, jd->away_state->code, jd->away_message);154 presence_send_update( gc ); 155 155 } 156 156 -
protocols/jabber/jabber.h
r5e202b0 r172a73f1 54 54 char *username; /* USERNAME@server */ 55 55 char *server; /* username@SERVER -=> server/domain, not hostname */ 56 57 /* After changing one of these two (or the priority setting), call 58 presence_send_update() to inform the server about the changes. */ 56 59 struct jabber_away_state *away_state; 57 60 char *away_message; … … 75 78 /* presence.c */ 76 79 xt_status jabber_pkt_presence( struct xt_node *node, gpointer data ); 77 int presence_send ( struct gaim_connection *gc, char *to, char *show, char *status);80 int presence_send_update( struct gaim_connection *gc ); 78 81 79 82 /* jabber_util.c */ -
protocols/jabber/jabber_util.c
r5e202b0 r172a73f1 29 29 { 30 30 account_t *acc = set->data; 31 char *ret; 31 32 32 /* Only run this stuff if the account is online ATM. */ 33 if( acc->gc ) 33 if( strcmp( set->key, "priority" ) == 0 ) 34 ret = set_eval_int( set, value ); 35 else 36 ret = value; 37 38 /* Only run this stuff if the account is online ATM, 39 and if the setting seems to be acceptable. */ 40 if( acc->gc && ret ) 34 41 { 35 /* ... */ 42 if( strcmp( set->key, "priority" ) == 0 ) 43 { 44 /* Although set_eval functions usually are very nice 45 and convenient, they have one disadvantage: If I 46 would just call p_s_u() now to send the new prio 47 setting, it would send the old setting because the 48 set->value gets changed when the eval returns a 49 non-NULL value. 50 51 So now I can choose between implementing post-set 52 functions next to evals, or just do this little 53 hack: */ 54 g_free( set->value ); 55 set->value = g_strdup( ret ); 56 57 /* (Yes, sorry, I prefer the hack. :-P) */ 58 59 presence_send_update( acc->gc ); 60 } 61 else 62 { 63 } 36 64 } 37 65 38 if( g_strcasecmp( set->key, "priority" ) == 0 ) 39 return set_eval_int( set, value ); 40 else 41 return value; 66 return ret; 42 67 } 43 68 -
protocols/jabber/presence.c
r5e202b0 r172a73f1 54 54 } 55 55 56 int presence_send( struct gaim_connection *gc, char *to, char *show, char *status ) 56 /* Whenever presence information is updated, call this function to inform the 57 server. */ 58 int presence_send_update( struct gaim_connection *gc ) 57 59 { 60 struct jabber_data *jd = gc->proto_data; 58 61 struct xt_node *node; 62 char *show = jd->away_state->code; 63 char *status = jd->away_message; 59 64 int st; 60 65 61 node = jabber_make_packet( "presence", NULL, to, NULL );66 node = jabber_make_packet( "presence", NULL, NULL, NULL ); 62 67 if( show && *show ) 63 68 xt_add_child( node, xt_new_node( "show", show, NULL ) ); 64 69 if( status ) 65 70 xt_add_child( node, xt_new_node( "status", status, NULL ) ); 71 /* if( set_getint( &gc->acc->set, "priority" ) != 0 ) */ 72 /* Let's just send this every time... */ 73 xt_add_child( node, xt_new_node( "priority", set_getstr( &gc->acc->set, "priority" ), NULL ) ); 66 74 67 75 st = jabber_write_packet( gc, node );
Note: See TracChangeset
for help on using the changeset viewer.