Skip to content

Commit

Permalink
We can now check for network JIDs (#1294)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Ricci <[email protected]>
  • Loading branch information
daniele-athome committed Apr 13, 2020
1 parent c2ec336 commit 8277029
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/src/main/java/org/kontalk/authenticator/MyAccount.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ class MyAccount (val systemAccount: Account, private val accountManager: Account

fun isSelfJID(bareJid: BareJid): Boolean = bareJid.equals(selfJID)

// TODO
fun isNetworkJID(bareJid: BareJid): Boolean = true
fun isNetworkJID(bareJid: BareJid): Boolean {
return serverList.first { it.network.equals(bareJid.domain.toString(), true) } != null
}

fun createLocalJID(localpart: String): String {
return XmppStringUtils.completeJidFrom(localpart, server.network);
Expand Down

0 comments on commit 8277029

Please sign in to comment.