1 20 21 package freecs.commands; 22 import freecs.interfaces.ICommand; 23 import freecs.content.MessageState; 24 29 public class CmdShowUserDetail extends AbstractCommand { 30 public final String cmd= "/w"; 31 private static final ICommand selve=new CmdShowUserDetail(); 32 33 private CmdShowUserDetail () { } 34 35 public static ICommand getInstance () { 36 return selve; 37 } 38 39 public boolean execute (MessageState msgState, String param) { 40 if (param.length () < 1) { 41 msgState.sourceGroup = msgState.sender.getGroup(); 42 msgState.targetGroup = msgState.sender.getGroup(); 43 if (!sendUserList (msgState, false)) { 44 msgState.msgTemplate = "error.w.nobodyHere"; 45 msgState.sender.sendMessage(msgState.mp); 46 return false; 47 } 48 } else { 49 msgState.usercontext = getUser (msgState, param); 50 if (msgState.usercontext == null) 51 return false; 52 msgState.msgTemplate = "message.user.detail"; 53 msgState.sender.sendMessage (msgState.mp); 54 } 55 return true; 56 } 57 } 58 | Popular Tags |