diff --git a/app/src/main/java/eu/droogers/smsmatrix/Matrix.java b/app/src/main/java/eu/droogers/smsmatrix/Matrix.java index ef6a45f..4e5b6ea 100644 --- a/app/src/main/java/eu/droogers/smsmatrix/Matrix.java +++ b/app/src/main/java/eu/droogers/smsmatrix/Matrix.java @@ -145,17 +145,19 @@ public class Matrix { if (session != null && session.isAlive()) { Room room = getRoomByPhonenumber(phoneNumber); if (room == null) { - Log.e(TAG, "sendMessage: not found" ); - session.createRoomDirectMessage(realUserid, new SimpleApiCallback() { - @Override - public void onSuccess(String info) { - super.onSuccess(info); - session.getRoomsApiClient().updateTopic(info, phoneNumber, new SimpleApiCallback()); - changeDisplayname(info, getContactName(phoneNumber, context)); - Room room = store.getRoom(info); - SendMesageToRoom(room, body, type); - } - }); + if (!type.equals("m.notice")) { + Log.e(TAG, "sendMessage: not found" ); + session.createRoomDirectMessage(realUserid, new SimpleApiCallback() { + @Override + public void onSuccess(String info) { + super.onSuccess(info); + session.getRoomsApiClient().updateTopic(info, phoneNumber, new SimpleApiCallback()); + changeDisplayname(info, getContactName(phoneNumber, context)); + Room room = store.getRoom(info); + SendMesageToRoom(room, body, type); + } + }); + } } else { changeDisplayname(room.getRoomId(), getContactName(phoneNumber, context)); SendMesageToRoom(room, body, type);