mirror of
https://github.com/ChronosX88/Influence.git
synced 2024-11-09 12:01:01 +00:00
Fixed bug with NetworkOnMainThread when initializing TrueTime (when send message)
This commit is contained in:
parent
cebfb33ff8
commit
6189252f2c
@ -52,11 +52,13 @@ public class ChatLogic implements CoreContracts.IChatLogicContract {
|
||||
}
|
||||
AppHelper.getXmppConnection().sendMessage(jid, text);
|
||||
while (!TrueTime.isInitialized()) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
TrueTime.build().initialize();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
long messageID = LocalDBWrapper.createMessageEntry(chatID, AppHelper.getJid(), TrueTime.now().getTime(), text, false, false);
|
||||
return LocalDBWrapper.getMessageByID(messageID);
|
||||
|
@ -16,11 +16,7 @@
|
||||
|
||||
package io.github.chronosx88.influence.presenters
|
||||
|
||||
import android.graphics.BitmapFactory
|
||||
import com.amulyakhare.textdrawable.TextDrawable
|
||||
import com.amulyakhare.textdrawable.util.ColorGenerator
|
||||
import com.google.gson.Gson
|
||||
import com.stfalcon.chatkit.commons.ImageLoader
|
||||
import com.stfalcon.chatkit.messages.MessageHolders
|
||||
import com.stfalcon.chatkit.messages.MessagesListAdapter
|
||||
import io.github.chronosx88.influence.R
|
||||
@ -34,13 +30,9 @@ import io.github.chronosx88.influence.models.appEvents.LastMessageEvent
|
||||
import io.github.chronosx88.influence.models.appEvents.NewMessageEvent
|
||||
import io.github.chronosx88.influence.models.roomEntities.ChatEntity
|
||||
import io.github.chronosx88.influence.models.roomEntities.MessageEntity
|
||||
import java9.util.concurrent.CompletableFuture
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
import org.jxmpp.jid.EntityBareJid
|
||||
import org.jxmpp.jid.impl.JidCreate
|
||||
import org.jxmpp.stringprep.XmppStringprepException
|
||||
|
||||
class ChatPresenter(private val view: CoreContracts.IChatViewContract, private val chatID: String) : CoreContracts.IChatPresenterContract {
|
||||
private val logic: CoreContracts.IChatLogicContract
|
||||
|
Loading…
Reference in New Issue
Block a user