zello-android-client-sdk icon indicating copy to clipboard operation
zello-android-client-sdk copied to clipboard

`muteContact` has no effect + questions

Open saiimons opened this issue 7 months ago • 1 comments

I am writing a piece of application which does the following:

  • Signs in as a gateway
  • Mutes all contacts except for a specific group/channel
  • Listens for incoming messages for the specific group

Here is a simple example I am running to test the logic:

    override fun onAppStateChanged() {
        val appState = AppState()
        Zello.getInstance().getAppState(appState)

        when {
            appState.isSignedIn -> {
                muteContacts()
            }
        }
    }

    private fun muteContacts() {
        val zello = Zello.getInstance()
        val contacts = zello.contacts ?: return
        (0 until contacts.count)
            .mapNotNull {
                contacts.getItem(it)
            }
            .forEach {
                val mute = it.type != ContactType.GROUP && it.name != "Everyone"
                Log.d("ZELLO", "Mute ${it.name}: $mute")
                zello.muteContact(it, mute)
            }
    }

A few questions:

  • even after calling muteContact(contact, true), I can hear messages coming directly from the user. Why isn't it muted?
  • will calling muteContact for a user also mute messages from this user in a group/channel, or only direct messages?

Please let me know if I am not using the API correctly, or if there is another way to achieve what I want.

saiimons avatar Nov 30 '23 05:11 saiimons

We aren't able to reproduce the issue reported above. Would you verify that contact muting is enabled in the admin console of your network?

zello-eugene avatar Feb 06 '24 14:02 zello-eugene