mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
add DcChat.getAccountId()
This commit is contained in:
@@ -17,7 +17,10 @@ public class DcChat {
|
||||
public final static int DC_CHAT_VISIBILITY_ARCHIVED = 1;
|
||||
public final static int DC_CHAT_VISIBILITY_PINNED = 2;
|
||||
|
||||
public DcChat(long chatCPtr) {
|
||||
private int accountId;
|
||||
|
||||
public DcChat(int accountId, long chatCPtr) {
|
||||
this.accountId = accountId;
|
||||
this.chatCPtr = chatCPtr;
|
||||
}
|
||||
|
||||
@@ -27,6 +30,7 @@ public class DcChat {
|
||||
chatCPtr = 0;
|
||||
}
|
||||
|
||||
public int getAccountId () { return accountId; }
|
||||
public native int getId ();
|
||||
public native int getType ();
|
||||
public native int getVisibility ();
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.b44t.messenger;
|
||||
|
||||
public class DcChatlist {
|
||||
|
||||
public DcChatlist(long chatlistCPtr) {
|
||||
private int accountId;
|
||||
|
||||
public DcChatlist(int accountId, long chatlistCPtr) {
|
||||
this.accountId = accountId;
|
||||
this.chatlistCPtr = chatlistCPtr;
|
||||
}
|
||||
|
||||
@@ -12,9 +15,10 @@ public class DcChatlist {
|
||||
chatlistCPtr = 0;
|
||||
}
|
||||
|
||||
public int getAccountId() { return accountId; }
|
||||
public native int getCnt ();
|
||||
public native int getChatId (int index);
|
||||
public DcChat getChat (int index) { return new DcChat(getChatCPtr(index)); }
|
||||
public DcChat getChat (int index) { return new DcChat(accountId, getChatCPtr(index)); }
|
||||
public native int getMsgId (int index);
|
||||
public DcMsg getMsg (int index) { return new DcMsg(getMsgCPtr(index)); }
|
||||
public DcLot getSummary(int index, DcChat chat) { return new DcLot(getSummaryCPtr(index, chat==null? 0 : chat.getChatCPtr())); }
|
||||
|
||||
@@ -158,8 +158,8 @@ public class DcContext {
|
||||
public native String getContactEncrInfo (int contact_id);
|
||||
public native boolean deleteContact (int id);
|
||||
public native int addAddressBook (String adrbook);
|
||||
public DcChatlist getChatlist (int listflags, String query, int queryId) { return new DcChatlist(getChatlistCPtr(listflags, query, queryId)); }
|
||||
public DcChat getChat (int chat_id) { return new DcChat(getChatCPtr(chat_id)); }
|
||||
public DcChatlist getChatlist (int listflags, String query, int queryId) { return new DcChatlist(getAccountId(), getChatlistCPtr(listflags, query, queryId)); }
|
||||
public DcChat getChat (int chat_id) { return new DcChat(getAccountId(), getChatCPtr(chat_id)); }
|
||||
public native String getChatEncrInfo (int chat_id);
|
||||
public native void markseenMsgs (int msg_ids[]);
|
||||
public native void marknoticedChat (int chat_id);
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
private ApplicationContext context;
|
||||
private Recipient recipient;
|
||||
private DcContext dcContext;
|
||||
private DcChat dcChat = new DcChat(0);
|
||||
private DcChat dcChat = new DcChat(0, 0);
|
||||
private int chatId;
|
||||
private final boolean isSecureText = true;
|
||||
private boolean isDefaultSms = true;
|
||||
|
||||
@@ -92,7 +92,7 @@ class ConversationListAdapter extends RecyclerView.Adapter {
|
||||
this.context = new WeakReference<>(context);
|
||||
this.glideRequests = glideRequests;
|
||||
this.dcContext = DcHelper.getContext(context);
|
||||
this.dcChatlist = new DcChatlist(0);
|
||||
this.dcChatlist = new DcChatlist(0, 0);
|
||||
this.locale = locale;
|
||||
this.inflater = LayoutInflater.from(context);
|
||||
this.clickListener = clickListener;
|
||||
@@ -195,7 +195,7 @@ class ConversationListAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
void changeData(@Nullable DcChatlist chatlist) {
|
||||
dcChatlist = chatlist == null ? new DcChatlist(0) : chatlist;
|
||||
dcChatlist = chatlist == null ? new DcChatlist(0, 0) : chatlist;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ public class Recipient {
|
||||
|
||||
public DcChat getChat()
|
||||
{
|
||||
return dcChat!=null? dcChat : new DcChat(0);
|
||||
return dcChat!=null? dcChat : new DcChat(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.b44t.messenger.DcChatlist;
|
||||
*/
|
||||
public class SearchResult {
|
||||
|
||||
public static final SearchResult EMPTY = new SearchResult("", new int[]{}, new DcChatlist(0), new int[]{});
|
||||
public static final SearchResult EMPTY = new SearchResult("", new int[]{}, new DcChatlist(0, 0), new int[]{});
|
||||
|
||||
private final String query;
|
||||
private final int[] contacts;
|
||||
|
||||
Reference in New Issue
Block a user