本文整理汇总了Java中chatty.util.api.ChannelInfo类的典型用法代码示例。如果您正苦于以下问题:Java ChannelInfo类的具体用法?Java ChannelInfo怎么用?Java ChannelInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChannelInfo类属于chatty.util.api包,在下文中一共展示了ChannelInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBan
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
@Override
public void onBan(User user, long duration, String reason, String targetMsgId) {
User localUser = c.getLocalUser(user.getChannel());
// Matcher m = findId.matcher(reason);
// String id = null;
// if (m.find()) {
// id = m.group();
// reason = reason.replace(id, "").trim();
// }
if (localUser != user && !localUser.hasModeratorRights()) {
// Remove reason if not the affected user and not a mod, to be
// consistent with other applications
reason = "";
}
g.userBanned(user, duration, reason, targetMsgId);
ChannelInfo channelInfo = api.getOnlyCachedChannelInfo(user.getName());
chatLog.userBanned(user.getChannel(), user.getRegularDisplayNick(),
duration, reason, channelInfo);
}
示例2: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
/**
* Channel Info received, which happens when Channel Info is requested
* or when a new status was successfully set.
*
* @param stream Then stream the info is for
* @param info The channel info
*/
public void setChannelInfo(String stream, ChannelInfo info, TwitchApi.RequestResultCode result) {
if (stream.equals(this.currentChannel)) {
if (result == TwitchApi.RequestResultCode.SUCCESS) {
status.setText(info.getStatus());
game.setText(info.getGame());
} else {
infoLastLoaded = -1;
if (result == TwitchApi.RequestResultCode.NOT_FOUND) {
statusLoadError = "Channel not found";
} else {
statusLoadError = "";
}
}
loadingStatus = false;
checkLoadingDone();
}
}
示例3: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
/**
* Channel Info received, which happens when Channel Info is requested
* or when a new status was successfully set.
*
* @param stream Then stream the info is for
* @param info The channel info
*/
public void setChannelInfo(String stream, ChannelInfo info, int result) {
if (stream.equals(this.currentChannel)) {
if (result == TwitchApi.SUCCESS) {
status.setText(info.getStatus());
game.setText(info.getGame());
updated.setText("Info last loaded: just now");
infoLastLoaded = System.currentTimeMillis();
statusEdited = false;
} else {
infoLastLoaded = -1;
if (result == TwitchApi.NOT_FOUND) {
updated.setText("Error loading info: Channel not found.");
} else {
updated.setText("Error loading info.");
}
}
}
setLoading(false);
//finishDialog();
}
示例4: userBanned
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void userBanned(String channel, String nick, long duration,
String reason, ChannelInfo info) {
String text = nick;
if (duration > 0) {
text += " ("+duration+"s)";
}
if (reason != null && !reason.isEmpty()) {
text += " ["+reason+"]";
}
if (info != null) {
text += " {"+DateTime.formatAccountAge(info.createdAt, Formatting.COMPACT)+"}";
}
compact(channel, "BAN", text);
}
示例5: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void setChannelInfo(final String channel, final ChannelInfo info, final RequestResultCode result) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
adminDialog.setChannelInfo(channel, info, result);
userInfoDialog.setChannelInfo(info);
}
});
}
示例6: showInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
private void showInfo() {
ChannelInfo requestedInfo = owner.getChannelInfo();
if (requestedInfo == null) {
addInfo();
createdAt.setText("Loading..");
createdAt.setToolTipText(null);
followers.setText(null);
} else {
addInfo();
setChannelInfo(requestedInfo);
}
}
示例7: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void setChannelInfo(ChannelInfo info) {
if (infoAdded) {
createdAt.setText("Registered: "+DateTime.formatAccountAge(info.createdAt, DateTime.Formatting.VERBOSE)+" ago");
createdAt.setToolTipText("Account created: "+DateTime.formatFullDatetime(info.createdAt));
followers.setText(" Followers: "+Helper.formatViewerCount(info.followers));
}
}
示例8: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void setChannelInfo(final String channel, final ChannelInfo info, final int result) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
adminDialog.setChannelInfo(channel, info, result);
}
});
}
示例9: receivedChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
@Override
public void receivedChannelInfo(String channel, ChannelInfo info, RequestResultCode result) {
g.setChannelInfo(channel, info, result);
}
示例10: putChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void putChannelInfo(ChannelInfo info) {
client.api.putChannelInfo(info);
}
示例11: getCachedChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public ChannelInfo getCachedChannelInfo(String channel, String id) {
return client.api.getCachedChannelInfo(channel, id);
}
示例12: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void setChannelInfo(String channel, ChannelInfo info, RequestResultCode result) {
statusPanel.setChannelInfo(channel, info, result);
}
示例13: setChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
public void setChannelInfo(ChannelInfo info) {
if (info == null || currentUser == null || !currentUser.getName().equals(info.name)) {
return;
}
infoPanel.setChannelInfo(info);
}
示例14: getChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
protected ChannelInfo getChannelInfo() {
return owner.getCachedChannelInfo(currentUser.getName(), currentUser.getId());
}
示例15: receivedChannelInfo
import chatty.util.api.ChannelInfo; //导入依赖的package包/类
@Override
public void receivedChannelInfo(String channel, ChannelInfo info, int result) {
g.setChannelInfo(channel, info, result);
}