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) { 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())); } } }
@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) { 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; } } } }
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()));
@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())); } } } }