1
1
mirror of https://github.com/ahabhyde/miguelbridge synced 2025-01-25 05:24:19 +01:00

Fixed null messages

This commit is contained in:
Ahab 2018-04-10 17:39:40 +02:00
parent 5a7d9e3507
commit bd1ae7c796

View File

@ -71,16 +71,19 @@ public class Launcher {
String matrixRoomId = (String) room.get("matrixid"); String matrixRoomId = (String) room.get("matrixid");
lastMessageId = getLastMessageId(matrixRoomId); lastMessageId = getLastMessageId(matrixRoomId);
newMessaggio = (String[]) matrixBot.getLastMessage(matrixRoomId);
if (!newMessaggio[0].equals(matrixBot.readBotUserName()) && try {
!newMessaggio[2].equals(lastMessageId) && newMessaggio = (String[]) matrixBot.getLastMessage(matrixRoomId);
!newMessaggio[1].equals("") && newMessaggio[1] != null) { if (!newMessaggio[0].equals(matrixBot.readBotUserName()) &&
String tgroomid = (String) room.get("tgid"); !newMessaggio[2].equals(lastMessageId) &&
tgBot.cEcho(tgroomid, newMessaggio[0] + ":\n" + newMessaggio[1]); !newMessaggio[1].equals("") && newMessaggio[1] != null) {
} String tgroomid = (String) room.get("tgid");
saveLastMessageId(newMessaggio[2], matrixRoomId); tgBot.cEcho(tgroomid, newMessaggio[0] + ":\n" + newMessaggio[1]);
saveLastMessageId(newMessaggio[2], matrixRoomId);
}
} catch (Exception e) {}
} }
} }