Commit 0b1f4d8f authored by Adrien Béraud's avatar Adrien Béraud
Browse files

account: log cleanup

Change-Id: I50e4ea3f55a576948a825c7be98ef5fbd5a68744
parent 6c82e4e3
......@@ -706,7 +706,6 @@ class Account(
}
fun getByUri(uri: Uri?): Conversation? {
Log.w(TAG, "getByUri $accountId $uri");
if (uri == null || uri.isEmpty) return null
return if (uri.isSwarm) getSwarm(uri.rawRingId) ?: pending[uri.uri] else getByKey(uri.uri)
}
......
......@@ -307,24 +307,22 @@ class AccountService(
}*/
val mode = if ("true" == info["syncing"]) Conversation.Mode.Syncing else Conversation.Mode.values()[info["mode"]!!.toInt()]
val conversation = account.newSwarm(conversationId, mode)
//if (mode != Conversation.Mode.Syncing) {
for (member in JamiService.getConversationMembers(accountId, conversationId)) {
/*for (Map.Entry<String, String> i : member.entrySet()) {
Log.w(TAG, "conversation member: " + i.getKey() + " " + i.getValue());
}*/
val uri = Uri.fromId(member["uri"]!!)
//String role = member.get("role");
val lastDisplayed = member["lastDisplayed"]
var contact = conversation.findContact(uri)
if (contact == null) {
contact = account.getContactFromCache(uri)
conversation.addContact(contact)
}
if (!StringUtils.isEmpty(lastDisplayed) && contact.isUser) {
conversation.setLastMessageRead(lastDisplayed)
}
for (member in JamiService.getConversationMembers(accountId, conversationId)) {
/*for (Map.Entry<String, String> i : member.entrySet()) {
Log.w(TAG, "conversation member: " + i.getKey() + " " + i.getValue());
}*/
val uri = Uri.fromId(member["uri"]!!)
//String role = member.get("role");
val lastDisplayed = member["lastDisplayed"]
var contact = conversation.findContact(uri)
if (contact == null) {
contact = account.getContactFromCache(uri)
conversation.addContact(contact)
}
//}
if (!StringUtils.isEmpty(lastDisplayed) && contact.isUser) {
conversation.setLastMessageRead(lastDisplayed)
}
}
conversation.lastElementLoaded = Completable.defer { loadMore(conversation, 2).ignoreElement() }.cache()
account.conversationStarted(conversation)
} catch (e: Exception) {
......@@ -1320,9 +1318,9 @@ class AccountService(
conversation: Conversation,
message: Map<String, String>
): Interaction {
for ((key, value) in message) {
/*for ((key, value) in message) {
Log.w(TAG, "$key -> $value")
}
}*/
val id = message["id"]!!
val type = message["type"]!!
val author = message["author"]!!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment