本文整理汇总了Java中org.schwering.irc.lib.IRCUser类的典型用法代码示例。如果您正苦于以下问题:Java IRCUser类的具体用法?Java IRCUser怎么用?Java IRCUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRCUser类属于org.schwering.irc.lib包,在下文中一共展示了IRCUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onKick
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onKick(String channel, IRCUser user, String passiveNick, String msg) {
// check to see if I got kick and if so rejoin if autoRejoin is on
if (passiveNick.equals(connection.getNick()) && configuration.isAutoRejoin()) {
endpoint.joinChannel(channel);
}
if (configuration.isOnKick()) {
Exchange exchange = endpoint.createOnKickExchange(channel, user, passiveNick, msg);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例2: onPrivmsg
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onPrivmsg(String arg0, IRCUser arg1, String arg2) {
final String message;
if (arg2.startsWith("ACTION")) {
message = "* " + arg1.getNick() + " " + arg2.substring(6);
} else {
message = "<<font color='#003366'>" + arg1.getNick()
+ "</font>> " + arg2;
}
runOnUiThread(new Runnable() {
@Override
public void run() {
chatBox.append(Html.fromHtml(message + "<br />"));
scrollDown();
}
});
}
示例3: IRCMessage
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
public IRCMessage(String channel, IRCUser user, String message) {
super(SCHEMA);
this.put("timestamp", System.currentTimeMillis());
this.put("channel", channel);
this.put("message", message);
this.put("user", new Struct(SCHEMA.field("user").schema())
.put("nick", user.getNick())
.put("username", user.getUsername())
.put("host", user.getHost())
);
}
示例4: onPrivmsg
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onPrivmsg(String channel, IRCUser u, String msg) {
IRCMessage event = new IRCMessage(channel, u, msg);
//FIXME kafka round robin default partitioner seems to always publish to partition 0 only (?)
long ts = event.getInt64("timestamp");
Map<String, ?> srcOffset = Collections.singletonMap(TIMESTAMP_FIELD, ts);
Map<String, ?> srcPartition = Collections.singletonMap(CHANNEL_FIELD, channel);
SourceRecord record = new SourceRecord(srcPartition, srcOffset, topic, KEY_SCHEMA, ts, IRCMessage.SCHEMA, event);
queue.offer(record);
}
示例5: onInvite
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onInvite(String chan, IRCUser user, String passiveNick) {
String content = user.getNick() + " invited me to join " + chan;
logger.info(content);
joinChannel(chan);
this.repository.add(chan);
this.bus.broadcast(message(content)).as("irc.invited");
}
示例6: onKick
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onKick(String chan, IRCUser user, String passiveNick, String msg) {
if (passiveNick.equals(configuration.getNickname())) {
String content = user.getNick() + " kicked me from " + chan;
logger.info(content);
this.bus.broadcast(message(content)).as("irc.kicked");
this.repository.remove(chan);
}
}
示例7: onPrivmsg
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onPrivmsg(String target, IRCUser user, String msg) {
LOG.debug("[{}] {}: {}.", target, user.getNick(), msg);
WikipediaEditEvent event = WikipediaEditEvent.fromRawEvent(
System.currentTimeMillis(),
target,
msg);
if (event != null) {
if (!edits.offer(event)) {
LOG.debug("Dropping message, because of full queue.");
}
}
}
示例8: onKick
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onKick(String channel, IRCUser user, String passiveNick, String msg) {
// check to see if I got kick and if so rejoin if autoRejoin is on
if (passiveNick.equals(connection.getNick()) && endpoint.getConfiguration().isAutoRejoin()) {
endpoint.joinChannel(channel);
}
}
示例9: IrcMessage
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
public IrcMessage(String messageType, String target, IRCUser user, String message) {
this.messageType = messageType;
this.target = target;
this.user = user;
this.message = message;
setBody(message);
}
示例10: onNick
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onNick(IRCUser user, String newNick) {
if (configuration.isOnNick()) {
Exchange exchange = endpoint.createOnNickExchange(user, newNick);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例11: onQuit
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onQuit(IRCUser user, String msg) {
if (configuration.isOnQuit()) {
Exchange exchange = endpoint.createOnQuitExchange(user, msg);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例12: onJoin
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onJoin(String channel, IRCUser user) {
if (configuration.isOnJoin()) {
Exchange exchange = endpoint.createOnJoinExchange(channel, user);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例13: onMode
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onMode(String channel, IRCUser user, IRCModeParser modeParser) {
if (configuration.isOnMode()) {
Exchange exchange = endpoint.createOnModeExchange(channel, user, modeParser);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例14: onPart
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onPart(String channel, IRCUser user, String msg) {
if (configuration.isOnPart()) {
Exchange exchange = endpoint.createOnPartExchange(channel, user, msg);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}
示例15: onTopic
import org.schwering.irc.lib.IRCUser; //导入依赖的package包/类
@Override
public void onTopic(String channel, IRCUser user, String topic) {
if (configuration.isOnTopic()) {
Exchange exchange = endpoint.createOnTopicExchange(channel, user, topic);
try {
getProcessor().process(exchange);
} catch (Exception e) {
handleException(e);
}
}
}