如何获取ejabberd MUC中的脱机用户列表?

问题描述

我正在使用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));
    }

有人可以帮忙吗?

解决方法

如果用户离线,那么他不在房间里,那么您的要求就没有意义了。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...