本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_chatParticipantCreator方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_chatParticipantCreator方法的具体用法?Java TLRPC.TL_chatParticipantCreator怎么用?Java TLRPC.TL_chatParticipantCreator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_chatParticipantCreator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChatAdminParticipantType
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private int getChatAdminParticipantType(TLRPC.ChatParticipant participant) {
if (participant instanceof TLRPC.TL_chatParticipantCreator) {
return 0;
} else if (participant instanceof TLRPC.TL_chatParticipantAdmin) {
return 1;
} else {
return 2;
}
}
示例2: isEnabled
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public boolean isEnabled(int i) {
if (i == allAdminsRow) {
return true;
} else if (i >= usersStartRow && i < usersEndRow) {
TLRPC.ChatParticipant participant = participants.get(i - usersStartRow);
if (!(participant instanceof TLRPC.TL_chatParticipantCreator)) {
return true;
}
}
return false;
}
示例3: updateOnlineCount
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateOnlineCount() {
onlineCount = 0;
int currentTime = ConnectionsManager.getInstance().getCurrentTime();
sortedUsers.clear();
if (info instanceof TLRPC.TL_chatFull || info instanceof TLRPC.TL_channelFull && info.participants_count <= 200 && info.participants != null) {
for (int a = 0; a < info.participants.participants.size(); a++) {
TLRPC.ChatParticipant participant = info.participants.participants.get(a);
TLRPC.User user = MessagesController.getInstance().getUser(participant.user_id);
if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
onlineCount++;
}
sortedUsers.add(a);
if (participant instanceof TLRPC.TL_chatParticipantCreator) {
creatorID = participant.user_id;
}
}
}
try {
Collections.sort(sortedUsers, new Comparator<Integer>() {
@Override
public int compare(Integer lhs, Integer rhs) {
TLRPC.User user1 = MessagesController.getInstance().getUser(info.participants.participants.get(rhs).user_id);
TLRPC.User user2 = MessagesController.getInstance().getUser(info.participants.participants.get(lhs).user_id);
int status1 = 0;
int status2 = 0;
if (user1 != null && user1.status != null) {
if (user1.id == UserConfig.getClientUserId()) {
status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
} else {
status1 = user1.status.expires;
}
//Telegram admin
if (user1.id == creatorID) {
status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000 - 100;
}
}
if (user2 != null && user2.status != null) {
if (user2.id == UserConfig.getClientUserId()) {
status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
} else {
status2 = user2.status.expires;
}
//Telegram admin
if (user2.id == creatorID) {
status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000 - 100;
}
}
if (status1 > 0 && status2 > 0) {
if (status1 > status2) {
return 1;
} else if (status1 < status2) {
return -1;
}
return 0;
} else if (status1 < 0 && status2 < 0) {
if (status1 > status2) {
return 1;
} else if (status1 < status2) {
return -1;
}
return 0;
} else if (status1 < 0 && status2 > 0 || status1 == 0 && status2 != 0) {
return -1;
} else if (status2 < 0 && status1 > 0 || status2 == 0 && status1 != 0) {
return 1;
}
return 0;
}
});
} catch (Exception e) {
FileLog.e("tmessages", e);
}
if (listAdapter != null) {
listAdapter.notifyItemRangeChanged(emptyRowChat2 + 1, sortedUsers.size());
}
}