aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-12-05 12:53:02 -0300
committerdequis <dx@dxzone.com.ar>2015-12-05 12:53:02 -0300
commitac68733ad7a5127395d6367b655a2d9de5d911b5 (patch)
tree43ba11b882ac40027a4baab06a65656b7cbf7798
parent9b02bab9832308cf88d86a379b3afd2f142816e2 (diff)
If imc_away_state_find() fails, try again finding "away"
Fixes trac ticket 1175, https://bugs.bitlbee.org/bitlbee/ticket/1175 "Setting away with libpurple fails silently except for a few values" Turns out the fallback was the first item of the list, which for libpurple's jabber is "Feeling" (what?) and seems to be a no-op in practice. With this commit the fallbacks are in this order: 1. Try to find whatever the user wrote in the away setting. 2. If that fails, find "away" in the away states. 3. If that fails, use the first away state. This might not fix it in some rare cases where the prpl doesn't have an away state equivalent to away. But hopefully the old fallback works for those, jabber was the weird one here.
-rw-r--r--protocols/nogaim.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 21152e0f..a5eda2e0 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -621,7 +621,8 @@ int imc_away_send_update(struct im_connection *ic)
if (away && *away) {
GList *m = ic->acc->prpl->away_states(ic);
msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL;
- away = imc_away_state_find(m, away, &msg) ? : m->data;
+ away = imc_away_state_find(m, away, &msg) ? :
+ (imc_away_state_find(m, "away", &msg) ? : m->data);
} else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) {
away = NULL;
msg = set_getstr(&ic->acc->set, "status") ?