问题描述
我正在使用ejabberd 20.04构建一个聊天应用程序(本机-android和ios)。我想在用户收到一对一聊天或MUC消息时发送离线用户通知。我在git上看到很多自定义库,并且它们全部用于一对一聊天。是MUC时,我需要像这样离线用户列表。
public void generator(View view) {
int one = new Random().nextInt(4);
int two;
do {
two = new Random().nextInt(4);
} while (two == one);
int three;
do {
three = new Random().nextInt(4);
} while (three == one || three == two);
int four;
do {
four = new Random().nextInt(4);
} while (four == one || four == two || four == three);
buttonOnebutton.setText(String.valueOf(one));
buttonTwobutton.setText(String.valueOf(two));
buttonThreebutton.setText(String.valueOf(three));
buttonFourbutton.setText(String.valueOf(four));
}
有人可以帮忙吗?
解决方法
如果用户离线,那么他不在房间里,那么您的要求就没有意义了。