Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/presence.c

    r24f113b r5ebff60  
    181181}
    182182
    183 static char *choose_priority(struct im_connection *ic)
    184 {
    185         struct jabber_data *jd = ic->proto_data;
    186         char *prio = set_getstr(&ic->acc->set, "priority");
    187 
    188         if (jd->away_state->code != NULL) {
    189                 int new_prio = (atoi(prio) - 5);
    190                 if (new_prio < 0) {
    191                         new_prio = 0;
    192                 }
    193                 return g_strdup_printf("%d", new_prio);
    194         }
    195 
    196         return g_strdup(prio);
    197 }
    198 
    199183/* Whenever presence information is updated, call this function to inform the
    200184   server. */
     
    205189        GSList *l;
    206190        int st;
    207         char *prio = choose_priority(ic);
    208191
    209192        node = jabber_make_packet("presence", NULL, NULL, NULL);
    210         xt_add_child(node, xt_new_node("priority", prio, NULL));
     193        xt_add_child(node, xt_new_node("priority", set_getstr(&ic->acc->set, "priority"), NULL));
    211194        if (jd->away_state) {
    212195                xt_add_child(node, xt_new_node("show", jd->away_state->code, NULL));
     
    239222
    240223        xt_free_node(node);
    241         g_free(prio);
    242224        return st;
    243225}
Note: See TracChangeset for help on using the changeset viewer.