Changeset 5e202b0 for protocols/jabber/jabber.c
- Timestamp:
- 2006-09-23T16:18:24Z (18 years ago)
- Branches:
- master
- Children:
- 172a73f1
- Parents:
- d8e0484
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber.c
rd8e0484 r5e202b0 111 111 xt_free( jd->xt ); 112 112 113 g_free( jd->away_message ); 113 114 g_free( jd->username ); 114 115 g_free( jd ); … … 128 129 } 129 130 130 /* TODO: For away state handling, implement some list like the one for MSN. */131 131 static GList *jabber_away_states( struct gaim_connection *gc ) 132 132 { 133 GList *l = NULL; 133 static GList *l = NULL; 134 int i; 134 135 135 l = g_list_append( l, (void*) "Online" ); 136 l = g_list_append( l, (void*) "Away" ); 137 l = g_list_append( l, (void*) "Extended Away" ); 138 l = g_list_append( l, (void*) "Do Not Disturb" ); 136 if( l == NULL ) 137 for( i = 0; jabber_away_state_list[i].full_name; i ++ ) 138 l = g_list_append( l, (void*) jabber_away_state_list[i].full_name ); 139 139 140 return ( l );140 return l; 141 141 } 142 142 143 static void jabber_set_away( struct gaim_connection *gc, char *state , char *message )143 static void jabber_set_away( struct gaim_connection *gc, char *state_txt, char *message ) 144 144 { 145 /* For now let's just always set state to "away" and send the message, if available. */ 146 presence_send( gc, NULL, g_strcasecmp( state, "Online" ) == 0 ? NULL : "away", message ); 145 struct jabber_data *jd = gc->proto_data; 146 struct jabber_away_state *state; 147 148 /* Save all this info. We need it, for example, when changing the priority setting. */ 149 state = (void *) jabber_away_state_by_name( state_txt ); 150 jd->away_state = state ? state : (void *) jabber_away_state_list; /* Fall back to "Away" if necessary. */ 151 g_free( jd->away_message ); 152 jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL; 153 154 presence_send( gc, NULL, jd->away_state->code, jd->away_message ); 147 155 } 148 156
Note: See TracChangeset
for help on using the changeset viewer.