mcabber/src/jabglue.c
changeset 745 413e95f3051a
parent 735 2f027806cd48
child 749 6c633adaae10
equal deleted inserted replaced
744:c3b76a1a07cb 745:413e95f3051a
   186 
   186 
   187   jab_poll(jc, 50);
   187   jab_poll(jc, 50);
   188 
   188 
   189   if (jstate == STATE_CONNECTING) {
   189   if (jstate == STATE_CONNECTING) {
   190     if (jc) {
   190     if (jc) {
   191       iqs *iqn;
   191       eviqs *iqn;
   192       xmlnode z;
   192       xmlnode z;
   193 
   193 
   194       iqn = iqs_new(JPACKET__GET, NS_AUTH, "auth", IQS_DEFAULT_TIMEOUT);
   194       iqn = iqs_new(JPACKET__GET, NS_AUTH, "auth", IQS_DEFAULT_TIMEOUT);
   195       iqn->callback = &iqscallback_auth;
   195       iqn->callback = &iqscallback_auth;
   196 
   196 
   463 
   463 
   464 // Note: the caller should check the jid is correct
   464 // Note: the caller should check the jid is correct
   465 void jb_addbuddy(const char *jid, const char *name, const char *group)
   465 void jb_addbuddy(const char *jid, const char *name, const char *group)
   466 {
   466 {
   467   xmlnode y, z;
   467   xmlnode y, z;
   468   iqs *iqn;
   468   eviqs *iqn;
   469   char *cleanjid;
   469   char *cleanjid;
   470 
   470 
   471   if (!online) return;
   471   if (!online) return;
   472 
   472 
   473   cleanjid = jidtodisp(jid);
   473   cleanjid = jidtodisp(jid);
   506 }
   506 }
   507 
   507 
   508 void jb_delbuddy(const char *jid)
   508 void jb_delbuddy(const char *jid)
   509 {
   509 {
   510   xmlnode x, y, z;
   510   xmlnode x, y, z;
   511   iqs *iqn;
   511   eviqs *iqn;
   512   char *cleanjid;
   512   char *cleanjid;
   513 
   513 
   514   if (!online) return;
   514   if (!online) return;
   515 
   515 
   516   cleanjid = jidtodisp(jid);
   516   cleanjid = jidtodisp(jid);
   552 }
   552 }
   553 
   553 
   554 void jb_updatebuddy(const char *jid, const char *name, const char *group)
   554 void jb_updatebuddy(const char *jid, const char *name, const char *group)
   555 {
   555 {
   556   xmlnode y;
   556   xmlnode y;
   557   iqs *iqn;
   557   eviqs *iqn;
   558   char *cleanjid;
   558   char *cleanjid;
   559   gchar *name_utf8;
   559   gchar *name_utf8;
   560 
   560 
   561   if (!online) return;
   561   if (!online) return;
   562 
   562 
   672 // Unlock a MUC room
   672 // Unlock a MUC room
   673 // room syntax: "room@server"
   673 // room syntax: "room@server"
   674 void jb_room_unlock(const char *room)
   674 void jb_room_unlock(const char *room)
   675 {
   675 {
   676   xmlnode y, z;
   676   xmlnode y, z;
   677   iqs *iqn;
   677   eviqs *iqn;
   678 
   678 
   679   if (!online || !room) return;
   679   if (!online || !room) return;
   680 
   680 
   681   iqn = iqs_new(JPACKET__SET, "http://jabber.org/protocol/muc#owner",
   681   iqn = iqs_new(JPACKET__SET, "http://jabber.org/protocol/muc#owner",
   682                 "unlock", IQS_DEFAULT_TIMEOUT);
   682                 "unlock", IQS_DEFAULT_TIMEOUT);
   694 // Destroy a MUC room
   694 // Destroy a MUC room
   695 // room syntax: "room@server"
   695 // room syntax: "room@server"
   696 void jb_room_destroy(const char *room, const char *venue, const char *reason)
   696 void jb_room_destroy(const char *room, const char *venue, const char *reason)
   697 {
   697 {
   698   xmlnode y, z;
   698   xmlnode y, z;
   699   iqs *iqn;
   699   eviqs *iqn;
   700 
   700 
   701   if (!online || !room) return;
   701   if (!online || !room) return;
   702 
   702 
   703   iqn = iqs_new(JPACKET__SET, "http://jabber.org/protocol/muc#owner",
   703   iqn = iqs_new(JPACKET__SET, "http://jabber.org/protocol/muc#owner",
   704                 "destroy", IQS_DEFAULT_TIMEOUT);
   704                 "destroy", IQS_DEFAULT_TIMEOUT);
   731 // Return 0 if everything is ok
   731 // Return 0 if everything is ok
   732 int jb_room_setattrib(const char *roomid, const char *jid, const char *nick,
   732 int jb_room_setattrib(const char *roomid, const char *jid, const char *nick,
   733                       struct role_affil ra, const char *reason)
   733                       struct role_affil ra, const char *reason)
   734 {
   734 {
   735   xmlnode y, z;
   735   xmlnode y, z;
   736   iqs *iqn;
   736   eviqs *iqn;
   737 
   737 
   738   if (!online || !roomid) return 1;
   738   if (!online || !roomid) return 1;
   739   if (!jid && !nick) return 1;
   739   if (!jid && !nick) return 1;
   740 
   740 
   741   if (check_jid_syntax((char*)roomid)) {
   741   if (check_jid_syntax((char*)roomid)) {