comparison mcabber/mcabber/xmpp.c @ 2075:f52b47f29ca0

Round high priority Merge patch from isbear's mcabber-patches repository (Mikael) A resource priority value must be an integer between -128 and +127.
author Myhailo Danylenko <isbear@ukrpost.net>
date Wed, 15 May 2013 13:32:42 +0300
parents c00b919cf4ac
children 88b6e9707e02
comparison
equal deleted inserted replaced
2074:e04b6dfbb054 2075:f52b47f29ca0
1488 g_free(bjid); 1488 g_free(bjid);
1489 return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS; 1489 return LM_HANDLER_RESULT_ALLOW_MORE_HANDLERS;
1490 } 1490 }
1491 1491
1492 p = lm_message_node_get_child_value(m->node, "priority"); 1492 p = lm_message_node_get_child_value(m->node, "priority");
1493 if (p && *p) bpprio = (gchar)atoi(p); 1493 if (p && *p) {
1494 else bpprio = 0; 1494 int rawprio = atoi(p);
1495 if (rawprio > 127)
1496 bpprio = 127;
1497 else if (rawprio < -128)
1498 bpprio = -128;
1499 else
1500 bpprio = rawprio;
1501 } else {
1502 bpprio = 0;
1503 }
1495 1504
1496 ust = available; 1505 ust = available;
1497 1506
1498 p = lm_message_node_get_child_value(m->node, "show"); 1507 p = lm_message_node_get_child_value(m->node, "show");
1499 if (p) { 1508 if (p) {