Changeset ac68733a for protocols


Ignore:
Timestamp:
2015-12-05T15:53:02Z (8 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
ed431c3
Parents:
9b02bab
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r9b02bab rac68733a  
    622622                GList *m = ic->acc->prpl->away_states(ic);
    623623                msg = ic->acc->flags & ACC_FLAG_AWAY_MESSAGE ? away : NULL;
    624                 away = imc_away_state_find(m, away, &msg) ? : m->data;
     624                away = imc_away_state_find(m, away, &msg) ? :
     625                       (imc_away_state_find(m, "away", &msg) ? : m->data);
    625626        } else if (ic->acc->flags & ACC_FLAG_STATUS_MESSAGE) {
    626627                away = NULL;
Note: See TracChangeset for help on using the changeset viewer.