From 32de74b1834befd75c5e06642a6b22d2ca0cac99 Mon Sep 17 00:00:00 2001 From: zedonboy Date: Thu, 21 Jan 2021 23:33:09 +0100 Subject: [PATCH] Changed Generic Exception to Concrete Exception --- .../com/fightpandemics/socketmanagerlib/SocketComponent.kt | 6 +++--- .../java/com/fightpandemics/socketmanagerlib/wsTypes.kt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/SocketComponent.kt b/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/SocketComponent.kt index fee47b7f..7f00b3ca 100644 --- a/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/SocketComponent.kt +++ b/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/SocketComponent.kt @@ -36,7 +36,7 @@ class SocketComponentBackend { * This property is a function that is in charge of a situation if a user is blocked * */ var forceRoomUpdate = fun(_: String){ - throw Exception("You must implement a forceUpdateListener. " + + throw UninitializedPropertyAccessException("You must implement a forceUpdateListener. " + ".forceRoomUpdate = ") } fun stop() { @@ -100,11 +100,11 @@ class SocketComponentBackend { }) } - fun deleteMessage(messageId : String, cb : wsCallBack? = null){ + fun deleteMessage(messageId : String){ _socket.emit(DELETE_MESSAGE, messageId) } - fun editMessage(data : Message, cb : wsCallBack? = null){ + fun editMessage(data : Message){ val jsonedMssg = _gson.toJson(data) _socket.emit(EDIT_MESSAGE, JSONObject(jsonedMssg)) } diff --git a/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/wsTypes.kt b/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/wsTypes.kt index 8a6476b5..aec1fce3 100644 --- a/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/wsTypes.kt +++ b/socketManagerLib/src/main/java/com/fightpandemics/socketmanagerlib/wsTypes.kt @@ -2,7 +2,7 @@ package com.fightpandemics.socketmanagerlib import com.google.gson.JsonElement -//TODO("fill up the Object properties") +//TODO("fill up the Object properties from Backend Models") data class Message(val content : String? = null, val authorId : String? = null){ val _id : String? = null }