comparison mcabber/src/jabglue.c @ 531:aee9a279a0f3

Allow changing priority on the fly
author Mikael Berthe <mikael@lilotux.net>
date Tue, 22 Nov 2005 23:36:12 +0100
parents d721b3502a77
children 2ac8d8e49e81
comparison
equal deleted inserted replaced
530:365e1ded7f1a 531:aee9a279a0f3
38 #define JABBER_AGENT_GROUP "Jabber Agents" 38 #define JABBER_AGENT_GROUP "Jabber Agents"
39 39
40 jconn jc; 40 jconn jc;
41 static time_t LastPingTime; 41 static time_t LastPingTime;
42 static unsigned int KeepaliveDelay; 42 static unsigned int KeepaliveDelay;
43 static unsigned int prio;
44 static int s_id; 43 static int s_id;
45 static int regmode, regdone; 44 static int regmode, regdone;
46 static enum imstatus mystatus = offline; 45 static enum imstatus mystatus = offline;
47 static gchar *mystatusmsg; 46 static gchar *mystatusmsg;
48 static unsigned char online; 47 static unsigned char online;
198 void jb_set_keepalive_delay(unsigned int delay) 197 void jb_set_keepalive_delay(unsigned int delay)
199 { 198 {
200 KeepaliveDelay = delay; 199 KeepaliveDelay = delay;
201 } 200 }
202 201
203 inline void jb_set_priority(unsigned int priority)
204 {
205 prio = priority;
206 }
207
208 void jb_main() 202 void jb_main()
209 { 203 {
210 xmlnode x, z; 204 xmlnode x, z;
211 char *cid; 205 char *cid;
212 206
271 265
272 void jb_setstatus(enum imstatus st, const char *recipient, const char *msg) 266 void jb_setstatus(enum imstatus st, const char *recipient, const char *msg)
273 { 267 {
274 xmlnode x; 268 xmlnode x;
275 gchar *utf8_msg; 269 gchar *utf8_msg;
270 unsigned int prio;
276 271
277 if (!online) return; 272 if (!online) return;
278 273
279 x = jutil_presnew(JPACKET__UNKNOWN, 0, 0); 274 x = jutil_presnew(JPACKET__UNKNOWN, 0, 0);
280 275
312 307
313 default: 308 default:
314 break; 309 break;
315 } 310 }
316 311
312 prio = settings_opt_get_int("priority");
317 if (prio) { 313 if (prio) {
318 char strprio[8]; 314 char strprio[8];
319 snprintf(strprio, 8, "%u", prio); 315 snprintf(strprio, 8, "%u", prio);
320 xmlnode_insert_cdata(xmlnode_insert_tag(x, "priority"), 316 xmlnode_insert_cdata(xmlnode_insert_tag(x, "priority"),
321 strprio, (unsigned) -1); 317 strprio, (unsigned) -1);