Using ChatStateListener with Smack 4.2.3 or 4.3.0-beta1

Hi there,
I want to send/receive Chat States following xep-0085 with Smack 4.2.2, 4.2.3 or 4.3.0-beta1 but still I don’t get it how… I mean I don’t want to create stuffs from scratch, so I found there is an interface called ChatStateListener… but at this moment it doesn’t uses Chat2, it said

// TODO Migrate to new chat2 API on Smack 4.3.

But the beta1 version is the same.

And the ChatStateManager.getInstance(connection).setCurrentState(); use Chat version 1 too.

So:

  1. What should I do to use ChatStateListener?
  2. How can I send those Chat states?

There is a PR I created that migrates the ChatState API to chat2. I’m not sure when this will be merged, but feel free to take inspiration from the code in case you cannot wait for another release :slight_smile:

Edit: Linking relevant topic: ChatStateManager requires: org.jivesoftware.smack.chat.Chat instead: org.jivesoftware.smack.chat2.Chat

1 Like