1 package org.columba.chat.command; 19 20 import org.columba.api.command.ICommandReference; 21 import org.columba.api.command.IWorkerStatusController; 22 import org.columba.chat.Connection; 23 import org.columba.chat.ui.frame.api.IChatFrameMediator; 24 import org.columba.core.command.Command; 25 import org.jivesoftware.smack.packet.Presence; 26 27 public class SubscriptionCommand extends Command { 28 29 public SubscriptionCommand(IChatFrameMediator mediator, 30 ICommandReference reference) { 31 super(reference); 32 33 } 34 35 38 @Override 39 public void updateGUI() throws Exception { 40 41 } 42 43 @Override 44 public void execute(IWorkerStatusController worker) throws Exception { 45 ChatCommandReference ref = (ChatCommandReference) getReference(); 46 String jabberId = ref.getJabberId(); 47 48 if (Connection.XMPPConnection.getRoster().contains(jabberId)) 50 return; 51 52 Presence packet = new Presence(Presence.Type.SUBSCRIBED); 53 packet.setTo(jabberId); 54 55 Connection.XMPPConnection.sendPacket(packet); 56 57 } 58 59 } | Popular Tags |