Merge remote-tracking branch 'upstream/main'

This commit is contained in:
adbenitez
2025-07-19 16:44:15 +02:00
92 changed files with 1581 additions and 1096 deletions
+7 -8
View File
@@ -6,7 +6,8 @@ public class DcChat {
public static final int DC_CHAT_TYPE_SINGLE = 100;
public static final int DC_CHAT_TYPE_GROUP = 120;
public static final int DC_CHAT_TYPE_MAILINGLIST = 140;
public static final int DC_CHAT_TYPE_BROADCAST = 160;
public static final int DC_CHAT_TYPE_OUT_BROADCAST = 160;
public static final int DC_CHAT_TYPE_IN_BROADCAST = 165;
public static final int DC_CHAT_NO_CHAT = 0;
public final static int DC_CHAT_ID_ARCHIVED_LINK = 6;
@@ -44,7 +45,6 @@ public class DcChat {
public native boolean isDeviceTalk ();
public native boolean canSend ();
public native boolean isProtected ();
public native boolean isProtectionBroken();
public native boolean isSendingLocations();
public native boolean isMuted ();
public native boolean isContactRequest ();
@@ -54,19 +54,18 @@ public class DcChat {
public boolean isMultiUser() {
int type = getType();
return type == DC_CHAT_TYPE_GROUP || type == DC_CHAT_TYPE_MAILINGLIST || type == DC_CHAT_TYPE_BROADCAST;
return type != DC_CHAT_TYPE_SINGLE;
}
public boolean isMailingList() {
return getType() == DC_CHAT_TYPE_MAILINGLIST;
}
public boolean isBroadcast() {
return getType() == DC_CHAT_TYPE_BROADCAST;
public boolean isInBroadcast() {
return getType() == DC_CHAT_TYPE_IN_BROADCAST;
}
public boolean isHalfBlocked() {
return isProtectionBroken() || isContactRequest();
public boolean isOutBroadcast() {
return getType() == DC_CHAT_TYPE_OUT_BROADCAST;
}
// working with raw c-data
@@ -10,8 +10,9 @@ public class DcContact {
public final static int DC_CONTACT_ID_NEW_GROUP = -2; // - " -
public final static int DC_CONTACT_ID_ADD_MEMBER = -3; // - " -
public final static int DC_CONTACT_ID_QR_INVITE = -4; // - " -
public final static int DC_CONTACT_ID_NEW_BROADCAST_LIST = -5; // - " -
public final static int DC_CONTACT_ID_NEW_BROADCAST = -5; // - " -
public final static int DC_CONTACT_ID_ADD_ACCOUNT = -6; // - " -
public final static int DC_CONTACT_ID_NEW_UNENCRYPTED_GROUP = -7; // - " -
public DcContact(long contactCPtr) {
this.contactCPtr = contactCPtr;
@@ -39,6 +39,7 @@ public class DcContext {
public final static int DC_GCL_VERIFIED_ONLY = 1;
public final static int DC_GCL_ADD_SELF = 2;
public final static int DC_GCL_ADDRESS = 0x04;
public final static int DC_GCL_ARCHIVED_ONLY = 0x01;
public final static int DC_GCL_NO_SPECIALS = 0x02;
public final static int DC_GCL_ADD_ALLDONE_HINT = 0x04;
+1 -1
View File
@@ -33,9 +33,9 @@ public class DcMsg {
public final static int DC_INFO_LOCATION_ONLY = 9;
public final static int DC_INFO_EPHEMERAL_TIMER_CHANGED = 10;
public final static int DC_INFO_PROTECTION_ENABLED = 11;
public final static int DC_INFO_PROTECTION_DISABLED = 12;
public final static int DC_INFO_INVALID_UNENCRYPTED_MAIL = 13;
public final static int DC_INFO_WEBXDC_INFO_MESSAGE = 32;
public final static int DC_INFO_CHAT_E2EE = 50;
public final static int DC_STATE_UNDEFINED = 0;
public final static int DC_STATE_IN_FRESH = 10;
@@ -160,6 +160,18 @@ public class Rpc {
getResult("add_or_update_transport", accountId, param);
}
public int createBroadcast(int accountId, String chatName) throws RpcException {
return gson.fromJson(getResult("create_broadcast", accountId, chatName), Integer.class);
}
public int createGroupChatUnencrypted(int accountId, String chatName) throws RpcException {
return gson.fromJson(getResult("create_group_chat_unencrypted", accountId, chatName), Integer.class);
}
public void setAccountsOrder(List<Integer> order) throws RpcException {
getResult("set_accounts_order", order);
}
private static class Request {
private final String jsonrpc = "2.0";
public final String method;