diff --git a/src/jabber.c b/src/jabber.c index 7709c405..8579cec3 100644 --- a/src/jabber.c +++ b/src/jabber.c @@ -364,7 +364,7 @@ jabber_update_presence(jabber_presence_t status, const char * const msg, return; pri = prefs_get_priority(); - if (pri < -128 || pri > 127) + if (pri < JABBER_PRIORITY_MIN || pri > JABBER_PRIORITY_MAX) pri = 0; jabber_conn.presence = status; diff --git a/src/jabber.h b/src/jabber.h index 897ca242..326328cc 100644 --- a/src/jabber.h +++ b/src/jabber.h @@ -49,6 +49,9 @@ typedef enum { PRESENCE_UNSUBSCRIBED } jabber_subscr_t; +#define JABBER_PRIORITY_MIN -128 +#define JABBER_PRIORITY_MAX 127 + void jabber_init(const int disable_tls); jabber_conn_status_t jabber_connect(const char * const jid, const char * const passwd, const char * const altdomain);