I’m developing an android app using smack-android:4.2.0-alpha1 and currently want to get a specific occupant and check whether the user is a mod or not.
After some time I noticed muc.getOccupant(string) ALWAYS returns null, so i checked it with my debugger and noticed this:
Okay, notice the full Jid, now I copy paste it and call this:
Gives null.
Then I checked the HashMap declaration, the key type is LocalDomainAndResourcePartJid so map.get(Object) will work for a string, but will always return null
Is this a confirmed bug or am I missing something?
Hmm… works now, but I can’t compile it because connection.loginAnonymously dissapeared! Was this deprecated before? conn.login(null, null) doesnt work either, so I can’t login as guest anymore?
Use “git log (-p) -S loginAnonymously” to see what happened.
An anonymous loginis not much different from a non-anonymous login, it just uses the SASL ANONYMOUS mechanism. The loginAnonymously was removed to slim down the XMPPConnection API in favor of a ConnectionConfiguration option: Smack/ConnectionConfiguration.java at master · igniterealtime/Smack · GitHub
Only one more question (sorry this isn’t about the original topic, but I recently upgraded from an, apparently, quite old version of the smack library, I feel like you turned the API upside down haha)
In the old version of my app, I just called .registerSASLMechanism(string, class) and .supportSASLMechanism(string), but now It’s quite different and I can’t find any example of this?
What I’m asking is, how do I register and support SASLAnonymous?
Tried a few aproaches on my own but they all resulted in an exception thrown on login (not-authorized)
ADD: Randomly trying everything that came into my mind, I got it working, but now I can’t join a muc!
Please open a new thread in the Smack Users forum about this different issue. Also have a look at How to ask for help or report an issue · igniterealtime/Smack Wiki · GitHub.
Especially the part about not providing textual information as screenshot. Thank you.
And while I welcome anyone willing to try alpha versions - Smack really needs alpha and beta testers - I’d like to point out that the API of such versions may change. Smack only guarantees as stable API between release candidates and patchlevel releases.