public void onServerMessage(ServerNumericMessage aServerMessage) { if (aServerMessage.getNumericCode() == IRCServerNumerics.NO_SUCH_CHANNEL || aServerMessage.getNumericCode() == IRCServerNumerics.NOT_CHANNEL_OP) { String _chan = aServerMessage.getText().split(" ")[0]; if (callbacks.containsKey(_chan)) { callbacks.remove(_chan).onFailure(new IRCException(aServerMessage.getText())); } } }
public ServerNumericMessage build(String aMessage) { int _indexOfCol = StringUtils.indexOf(' ', 3, aMessage); String _firstPart = aMessage.substring(0, _indexOfCol); String _secondPart = aMessage.substring(_indexOfCol + 1); String[] _firstPartCmpnts = _firstPart.split(" "); return new ServerNumericMessage(getNumberFrom(_firstPartCmpnts[1]), _secondPart, new IRCServer(_firstPartCmpnts[0].substring(1))); }
@Override public MessageFilterResult filter(IMessage aMsg) { if (aMsg instanceof ServerNumericMessage) { String aText = ((ServerNumericMessage) aMsg).getText(); String cmpnts[] = aText.split(" :"); if (nextValues.remove(cmpnts[0])) { return new MessageFilterResult(null, FilterStatus.HALT); } } return new MessageFilterResult(aMsg, FilterStatus.PASS); }
public void onServerMessage(ServerNumericMessage aServerMessage) { if (aServerMessage.getNumericCode() == IRCServerNumerics.NO_SUCH_CHANNEL) { String _chan = aServerMessage.getText().split(" ")[0]; if (callbacks.containsKey(_chan)) { callbacks.remove(_chan).onFailure(new IRCException(aServerMessage.getText())); } } }
public void onServerMessage(ServerNumericMessage aServerMessage) { Callback<String> _callback = callbacks.remove(aServerMessage.getText().split(" ")[0]); if (_callback != null) { if (aServerMessage.getNumericCode().equals(IRCServerNumerics.NICKNAME_IN_USE)) { _callback.onFailure(new IRCException(aServerMessage.getText())); } else if (aServerMessage.getNumericCode().equals(IRCServerNumerics.ERRONEUS_NICKNAME)) { _callback.onFailure(new IRCException(aServerMessage.getText())); } else if (aServerMessage.getNumericCode().equals(IRCServerNumerics.ERR_NICKTOOFAST)) { _callback.onFailure(new IRCException(aServerMessage.getText())); } } } }
public void onServerMsg(ServerNumericMessage aMsg) { if (NUMERICS.contains(aMsg.getNumericCode())) { String aText = aMsg.getText(); String cmpnts[] = aText.split(" :"); AsyncTriple _aTrip = myQueue.peek(); if (_aTrip != null) { if (_aTrip.asyncId.equals(cmpnts[0])) { _aTrip = myQueue.poll(); if (!_aTrip.flag) { _aTrip.callback.onSuccess("OK"); } } else { _aTrip.callback.onFailure(new IRCException(aText)); _aTrip.flag = true; } } } }
@Override public void onMessage(IMessage aMessage) { if (aMessage instanceof TopicMessage) { TopicMessage _topicMsg = (TopicMessage) aMessage; callback.onSuccess(_topicMsg.getTopic().getValue()); } else if (aMessage instanceof ServerNumericMessage) { if (((ServerNumericMessage) aMessage).getNumericCode().equals(IRCServerNumerics.NOT_CHANNEL_OP)) { callback.onFailure(new IRCException(((ServerNumericMessage) aMessage).getText())); } } } }
public void onServerMessage(ServerNumericMessage aServMsg) if (aServMsg.getNumericCode() == IRCServerNumerics.NICKNAME_IN_USE) else if (aServMsg.getNumericCode() == IRCServerNumerics.ERRONEUS_NICKNAME) else if (aServMsg.getNumericCode() == IRCServerNumerics.SERVER_WELCOME_MESSAGE) nick = getNick(aServMsg.getText()); else if (aServMsg.getNumericCode().equals(IRCServerNumerics.SERVER_OPTIONS)) String _opts[] = aServMsg.getText().split(" "); for (String _opt : _opts) else if (aServMsg.getNumericCode().equals(IRCServerNumerics.MOTD_FILE_MISSING) || aServMsg.getNumericCode().equals(IRCServerNumerics.END_OF_MOTD))
public void onServerMessage(ServerNumericMessage aServerMessage) int _numcode = aServerMessage.getNumericCode(); if (_numcode == IRCServerNumerics.CHANNEL_FORWARD || _numcode == IRCServerNumerics.TOPIC_USER_DATE || _numcode == IRCServerNumerics.CHANNEL_NICKS_LIST || _numcode == IRCServerNumerics.CHANNEL_TOPIC || _numcode == IRCServerNumerics.CHANNEL_NICKS_END_OF_LIST channel.setName(aServerMessage.getText().split(" ")[1]); String _nicks[] = aServerMessage.getText().substring(aServerMessage.getText().indexOf(":") + 1).split(" "); for (String _nick : _nicks) String _cmpnts[] = aServerMessage.getText().split(" "); topic.setSetBy(_cmpnts[1]); topic.setDate(new Date(Long.parseLong(_cmpnts[2] + "000"))); else if (callbacks.containsKey(getChannelNameFrom(aServerMessage.getText()))) callbacks.remove(getChannelNameFrom(aServerMessage.getText())).onFailure(new IRCException(aServerMessage.getText())); callbacks.remove(getChannelNameFrom(aServerMessage.getText())).onFailure(new IRCException(aServerMessage.getText())); callbacks.remove(getChannelNameFrom(aServerMessage.getText())).onFailure(new IRCException(aServerMessage.getText()));