mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
40 lines
992 B
Java
40 lines
992 B
Java
package org.thoughtcrime.securesms.connect;
|
|
|
|
|
|
import android.content.Context;
|
|
import android.support.annotation.NonNull;
|
|
import android.util.Log;
|
|
|
|
import com.b44t.messenger.DcChatlist;
|
|
|
|
import org.thoughtcrime.securesms.util.AsyncLoader;
|
|
|
|
public class DcChatlistLoader extends AsyncLoader<DcChatlist> {
|
|
|
|
private static final String TAG = DcChatlistLoader.class.getName();
|
|
|
|
private final int listflags;
|
|
private final String query;
|
|
private final int queryId;
|
|
|
|
public DcChatlistLoader(Context context, int listflags, String query, int queryId) {
|
|
super(context);
|
|
this.listflags = listflags;
|
|
this.query = query;
|
|
this.queryId = queryId;
|
|
}
|
|
|
|
@Override
|
|
public @NonNull
|
|
DcChatlist loadInBackground() {
|
|
try {
|
|
return DcHelper.getContext(getContext()).getChatlist(listflags, query, queryId);
|
|
|
|
} catch (Exception e) {
|
|
Log.w(TAG, e);
|
|
}
|
|
|
|
return new DcChatlist(0);
|
|
}
|
|
}
|