1
0
mirror of https://github.com/tijder/SmsMatrix.git synced 2024-10-27 18:24:01 +00:00

Dont create a new room for a incomming call

This commit is contained in:
Gerben Droogers 2017-12-09 22:23:42 +01:00
parent 269061fe43
commit 9099d8f0df

View File

@ -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<String>() {
@Override
public void onSuccess(String info) {
super.onSuccess(info);
session.getRoomsApiClient().updateTopic(info, phoneNumber, new SimpleApiCallback<Void>());
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<String>() {
@Override
public void onSuccess(String info) {
super.onSuccess(info);
session.getRoomsApiClient().updateTopic(info, phoneNumber, new SimpleApiCallback<Void>());
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);