From eb73d05e00156afd5ea6d7819d0d7ef2ccadedde Mon Sep 17 00:00:00 2001 From: dequis Date: Sun, 7 May 2017 16:06:29 -0300 Subject: Fix status message being set to null accidentally In other words, "account jabber set away Message" resulted in away status being set, but not "Message". Fixes trac ticket 1291 This was broken by ac68733ad7a5127395d6367b655a2d9de5d911b5 (3.4.2) That commit added another call of imc_away_state_find() with the fixed string "away", so purple protocols can become away by setting away to any string. But by doing so, it wiped the status message because it's the same as the name of the away state. --- protocols/nogaim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 3fed2728..58f74f8b 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -767,7 +767,7 @@ int imc_away_send_update(struct im_connection *ic) } msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL; away = imc_away_state_find(m, away, &msg) ? : - (imc_away_state_find(m, "away", &msg) ? : m->data); + (imc_away_state_find(m, "away", NULL) ? : m->data); } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) { away = NULL; msg = set_getstr(&ic->acc->set, "status") ? @@ -801,7 +801,7 @@ static char *imc_away_state_find(GList *gcm, char *away, char **message) /* At least the Yahoo! module works better if message contains no data unless it adds something to what we have in state already. */ - if (strlen(m->data) == strlen(away)) { + if (message && strlen(m->data) == strlen(away)) { *message = NULL; } @@ -827,7 +827,7 @@ static char *imc_away_state_find(GList *gcm, char *away, char **message) for (j = 0; imc_away_alias_list[i][j]; j++) { for (m = gcm; m; m = m->next) { if (g_strcasecmp(imc_away_alias_list[i][j], m->data) == 0) { - if (!keep_message) { + if (!keep_message && message) { *message = NULL; } -- cgit v1.2.3