/* 
 * Copyright 2014 OpenMarket Ltd
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.matrix.androidsdk.rest.model;

/**
 * This class describes the device information
 */
public class DeviceInfo {
    public String user_id;
    public String display_name;
    public long last_seen_ts = 0;
    public String last_seen_ip;
    public String device_id;
}

@@ -638,16 +638,99 @@
 model;%0A%0A
+import java.util.Collections;%0Aimport java.util.Comparator;%0Aimport java.util.List;%0A%0A
 /**%0A * T
@@ -956,10 +956,703 @@
 ice_id;%0A
+%0A%0A    /**%0A     * Sort a devices list by their presence (%0A     * @param deviceInfos%0A     */%0A    public static void sortByLastSeen(List%3CDeviceInfo%3E deviceInfos) %7B%0A        if (null != deviceInfos)%0A            Collections.sort(deviceInfos,  new Comparator%3CDeviceInfo%3E() %7B%0A                @Override%0A                public int compare(DeviceInfo lhs, DeviceInfo rhs) %7B%0A                    if (lhs.last_seen_ts == rhs.last_seen_ts) %7B%0A                        return 0;%0A                    %7D else  if (lhs.last_seen_ts %3E rhs.last_seen_ts) %7B%0A                        return +1;%0A                    %7D else %7B%0A                        return -1;%0A                    %7D%0A                %7D%0A            %7D);%0A    %7D%0A
 %7D%0A

Add a sort method