Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21e9d981 authored by Luca Georges Francois's avatar Luca Georges Francois
Browse files

[+] Update front crash.

parent aaf45d07
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -23,7 +23,7 @@ class MainActivity : AppCompatActivity() {
        val userTextInput: EditText = findViewById(R.id.userTextInput)
        val userTextInput: EditText = findViewById(R.id.userTextInput)


        val client = OkHttpClient();
        val client = OkHttpClient();
        val ipAddress = "192.168.0.14"
        val ipAddress = "172.20.10.5"
        val request: Request = Request.Builder().url("ws://${ipAddress}:8080/websocket").build()
        val request: Request = Request.Builder().url("ws://${ipAddress}:8080/websocket").build()
        val listener = LeonWebSocket(chat, plugins, this)
        val listener = LeonWebSocket(chat, plugins, this)
        val ws: WebSocket = client.newWebSocket(request, listener)
        val ws: WebSocket = client.newWebSocket(request, listener)
+1 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ class PluginManager(context: Context, activity: Activity, view: LeonView) {
    }
    }


    private fun openAppPluginManager(data: JSONObject) {
    private fun openAppPluginManager(data: JSONObject) {
        Log.d("Leon", "${data["appname"]}")
        val appName = data["appname"] as String
        val appName = data["appname"] as String


        openApp.run(appName)
        openApp.run(appName)
+6 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,11 @@ class LeonWebSocket(view: LeonView, plugins: PluginManager, activity: Activity):
        mainActivity.runOnUiThread {
        mainActivity.runOnUiThread {
            chat.addOliviaBubble(oliviaResponse)
            chat.addOliviaBubble(oliviaResponse)
        }
        }
        pluginManager.run(pluginName, obj["data"] as JSONObject)
        val data = obj["data"] as JSONObject
        if (data.length() == 0) {
            return ;
        }
        pluginManager.run(pluginName, data)
    }
    }


    override fun onMessage(webSocket: WebSocket, bytes: ByteString) {
    override fun onMessage(webSocket: WebSocket, bytes: ByteString) {
@@ -50,6 +54,7 @@ class LeonWebSocket(view: LeonView, plugins: PluginManager, activity: Activity):


    override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
    override fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?) {
        Log.d("LeonWebSocket", "WebSocket failure : [${t.message}]")
        Log.d("LeonWebSocket", "WebSocket failure : [${t.message}]")
        webSocket.close(1000,"Socket off")
    }
    }


    fun onSend(webSocket: WebSocket, content: String) {
    fun onSend(webSocket: WebSocket, content: String) {