aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-03-06 14:50:52 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-03-06 14:50:52 +0000
commit840bba81bc4ab7ce37aeeea5f32091684b19e5b8 (patch)
tree0baee2717433122e7ccd4d49617825e8db2b9400 /protocols/jabber/jabber.c
parentd1ad6f0973bda799bdf21e36f20dc58f7bb1bf08 (diff)
The Jabber part of the change. Also made representation of not-away a bit
more consistent. Except for free-for-chat, which is nuts anyway.
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r--protocols/jabber/jabber.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index b8e88c26..35cf08c5 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -79,6 +79,8 @@ static void jabber_init( account_t *acc )
s = set_add( &acc->set, "xmlconsole", "false", set_eval_bool, acc );
s->flags |= ACC_SET_OFFLINE_ONLY;
+
+ acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
}
static void jabber_generate_id_hash( struct jabber_data *jd );
@@ -376,11 +378,12 @@ static void jabber_get_info( struct im_connection *ic, char *who )
static void jabber_set_away( struct im_connection *ic, char *state_txt, char *message )
{
struct jabber_data *jd = ic->proto_data;
- struct jabber_away_state *state;
- /* Save all this info. We need it, for example, when changing the priority setting. */
- state = (void *) jabber_away_state_by_name( state_txt );
- jd->away_state = state ? state : (void *) jabber_away_state_list; /* Fall back to "Away" if necessary. */
+ /* state_txt == NULL -> Not away.
+ Unknown state -> fall back to the first defined away state. */
+ jd->away_state = state_txt ? jabber_away_state_by_name( state_txt )
+ ? : jabber_away_state_list : NULL;
+
g_free( jd->away_message );
jd->away_message = ( message && *message ) ? g_strdup( message ) : NULL;