本文整理汇总了Java中org.telegram.tgnet.TLRPC.ChatParticipant方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.ChatParticipant方法的具体用法?Java TLRPC.ChatParticipant怎么用?Java TLRPC.ChatParticipant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.ChatParticipant方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkBotCommands
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void checkBotCommands() {
URLSpanBotCommand.enabled = false;
if (currentUser != null && currentUser.bot) {
URLSpanBotCommand.enabled = true;
} else if (info instanceof TLRPC.TL_chatFull) {
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.bot) {
URLSpanBotCommand.enabled = true;
break;
}
}
} else if (info instanceof TLRPC.TL_channelFull) {
URLSpanBotCommand.enabled = !info.bot_info.isEmpty();
}
}
示例2: updateOnlineCount
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void updateOnlineCount() {
onlineCount = 0;
TLRPC.ChatFull info = parentFragment.getCurrentChatInfo();
if (info == null) {
return;
}
int currentTime = ConnectionsManager.getInstance().getCurrentTime();
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++;
}
}
}
}
示例3: checkBotCommands
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void checkBotCommands() {
URLSpanBotCommand.enabled = false;
if (currentUser != null && currentUser.bot) {
URLSpanBotCommand.enabled = true;
} else if (info instanceof TLRPC.TL_chatFull) {
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.bot) {
URLSpanBotCommand.enabled = true;
break;
}
}
} else if (info instanceof TLRPC.TL_channelFull) {
URLSpanBotCommand.enabled = !info.bot_info.isEmpty();
}
}
示例4: fetchUsersFromChannelInfo
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void fetchUsersFromChannelInfo() {
if (info instanceof TLRPC.TL_channelFull && info.participants != null) {
for (int a = 0; a < info.participants.participants.size(); a++) {
TLRPC.ChatParticipant chatParticipant = info.participants.participants.get(a);
participantsMap.put(chatParticipant.user_id, chatParticipant);
}
}
}
示例5: 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;
}
}
示例6: 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;
}
示例7: updateSearchResults
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateSearchResults(final ArrayList<TLRPC.ChatParticipant> users, final ArrayList<CharSequence> names) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
searchResult = users;
searchResultNames = names;
notifyDataSetChanged();
}
});
}
示例8: fetchUsersFromChannelInfo
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void fetchUsersFromChannelInfo() {
if (info instanceof TLRPC.TL_channelFull && info.participants != null) {
for (int a = 0; a < info.participants.participants.size(); a++) {
TLRPC.ChatParticipant chatParticipant = info.participants.participants.get(a);
participantsMap.put(chatParticipant.user_id, chatParticipant);
if(((TLRPC.TL_chatChannelParticipant) chatParticipant).channelParticipant instanceof TLRPC.TL_channelParticipantCreator){
creatorID = chatParticipant.user_id;
}
}
}
}
示例9: 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);
}
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;
}
}
if (user2 != null && user2.status != null) {
if (user2.id == UserConfig.getClientUserId()) {
status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
} else {
status2 = user2.status.expires;
}
}
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());
}
}
}
示例10: getItem
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public TLRPC.ChatParticipant getItem(int i) {
return searchResult.get(i);
}
示例11: 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());
}
}