Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2018-08-03 11:38:12 +02:00
parent 77f8652177
commit 3c9953196a
2 changed files with 9 additions and 2 deletions

View file

@ -280,8 +280,13 @@ public class CallsListController extends BaseController implements SearchView.On
adapter.updateDataSet(callItems, true);
Collections.sort(callItems, (callItem, t1) ->
Long.compare(t1.getModel().getLastPing(), callItem.getModel().getLastPing()));
if (currentUser.hasSpreedCapabilityWithName("last-room-activity")) {
Collections.sort(callItems, (callItem, t1) ->
Long.compare(t1.getModel().getLastActivity(), callItem.getModel().getLastActivity()));
} else {
Collections.sort(callItems, (callItem, t1) ->
Long.compare(t1.getModel().getLastPing(), callItem.getModel().getLastPing()));
}
if (searchItem != null) {
searchItem.setVisible(callItems.size() > 0);

View file

@ -65,6 +65,8 @@ public class Room {
public String password;
@JsonField(name = "isFavorite")
public boolean isFavorite;
@JsonField(name = "lastActivity")
public long lastActivity;
public boolean isPublic() {
return (RoomType.ROOM_PUBLIC_CALL.equals(type));