disco.c
changeset 34 1a62a570e66b
parent 33 104ecab6a1d5
child 39 ab9dad1e6d66
equal deleted inserted replaced
33:104ecab6a1d5 34:1a62a570e66b
   583 				to = to_utf8 (p);
   583 				to = to_utf8 (p);
   584 
   584 
   585 			if (args[2])
   585 			if (args[2])
   586 				dnode = to_utf8 (args[2]);
   586 				dnode = to_utf8 (args[2]);
   587 		}
   587 		}
   588 			// XXX send to all resources/current resource?
   588 
       
   589         if (!to) {
       
   590 		    // Use currently selected item, if possible
       
   591 			if (current_buddy) {
       
   592 			    gpointer bud = BUDDATA(current_buddy);
       
   593 				if (bud) {
       
   594 					guint type = buddy_gettype (bud);
       
   595 					if (type != ROSTER_TYPE_GROUP && type != ROSTER_TYPE_SPECIAL)
       
   596 						to = g_strdup (buddy_getjid (bud)); // XXX memleak!
       
   597 				  }
       
   598 			}
       
   599         }
       
   600 
       
   601 		if (!to) {
       
   602 		  scr_log_print (LPRINT_NORMAL, "Invalid disco target.");
       
   603 		  free_arg_lst (args);
       
   604 		  return;
       
   605 		}
       
   606 
       
   607 		// XXX send to all resources/current resource?
   589 
   608 
   590 		{
   609 		{
   591 			disco_handler_t *cb = g_new (disco_handler_t, 1);
   610 			disco_handler_t *cb = g_new (disco_handler_t, 1);
   592 
   611 
   593 			cb -> jid  = to ? to : g_strdup (CURRENT_JID);
   612 			cb -> jid  = to;
   594 			cb -> node = dnode;
   613 			cb -> node = dnode;
   595 
   614 
   596 			if (info)
   615 			if (info)
   597 				disco_info_request (cb -> jid, cb -> node, disco_info_handler, cb, disco_handler_destroy_notify);
   616 				disco_info_request (cb -> jid, cb -> node, disco_info_handler, cb, disco_handler_destroy_notify);
   598 			else
   617 			else