Merge branch 'main' into adb/remove-realtime-toggle

This commit is contained in:
adb
2025-12-15 12:51:27 +01:00
committed by GitHub
53 changed files with 465 additions and 417 deletions
@@ -94,7 +94,7 @@ public abstract class BaseTransport implements Rpc.Transport {
}
if (response.error != null) {
future.setException(new RpcException(response.error.toString()));
future.setException(new RpcException(response.error.message));
} else if (response.result != null) {
future.set(response.result);
} else {
@@ -115,10 +115,15 @@ public abstract class BaseTransport implements Rpc.Transport {
}
}
private static class RpcError {
public int code;
public String message;
}
private static class Response {
public String jsonrpc;
public int id;
public JsonNode result;
public JsonNode error;
public RpcError error;
}
}
+45 -45
View File
@@ -23,17 +23,17 @@ public class Rpc {
this.mapper = transport.getObjectMapper();
}
/* Test function. */
/** Test function. */
public void sleep(Float delay) throws RpcException {
transport.call("sleep", mapper.valueToTree(delay));
}
/* Checks if an email address is valid. */
/** Checks if an email address is valid. */
public Boolean checkEmailValidity(String email) throws RpcException {
return transport.callForResult(new TypeReference<Boolean>(){}, "check_email_validity", mapper.valueToTree(email));
}
/* Returns general system info. */
/** Returns general system info. */
public java.util.Map<String, String> getSystemInfo() throws RpcException {
return transport.callForResult(new TypeReference<java.util.Map<String, String>>(){}, "get_system_info");
}
@@ -73,12 +73,12 @@ public class Rpc {
return transport.callForResult(new TypeReference<java.util.List<Integer>>(){}, "get_all_account_ids");
}
/* Select account in account manager, this saves the last used account to accounts.toml */
/** Select account in account manager, this saves the last used account to accounts.toml */
public void selectAccount(Integer id) throws RpcException {
transport.call("select_account", mapper.valueToTree(id));
}
/* Get the selected account from the account manager (on startup it is read from accounts.toml) */
/** Get the selected account from the account manager (on startup it is read from accounts.toml) */
public Integer getSelectedAccountId() throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "get_selected_account_id");
}
@@ -93,17 +93,17 @@ public class Rpc {
transport.call("set_accounts_order", mapper.valueToTree(order));
}
/* Get a list of all configured accounts. */
/** Get a list of all configured accounts. */
public java.util.List<Account> getAllAccounts() throws RpcException {
return transport.callForResult(new TypeReference<java.util.List<Account>>(){}, "get_all_accounts");
}
/* Starts background tasks for all accounts. */
/** Starts background tasks for all accounts. */
public void startIoForAllAccounts() throws RpcException {
transport.call("start_io_for_all_accounts");
}
/* Stops background tasks for all accounts. */
/** Stops background tasks for all accounts. */
public void stopIoForAllAccounts() throws RpcException {
transport.call("stop_io_for_all_accounts");
}
@@ -123,27 +123,27 @@ public class Rpc {
transport.call("stop_background_fetch");
}
/* Starts background tasks for a single account. */
/** Starts background tasks for a single account. */
public void startIo(Integer accountId) throws RpcException {
transport.call("start_io", mapper.valueToTree(accountId));
}
/* Stops background tasks for a single account. */
/** Stops background tasks for a single account. */
public void stopIo(Integer accountId) throws RpcException {
transport.call("stop_io", mapper.valueToTree(accountId));
}
/* Get top-level info for an account. */
/** Get top-level info for an account. */
public Account getAccountInfo(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<Account>(){}, "get_account_info", mapper.valueToTree(accountId));
}
/* Get the current push notification state. */
/** Get the current push notification state. */
public NotifyState getPushState(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<NotifyState>(){}, "get_push_state", mapper.valueToTree(accountId));
}
/* Get the combined filesize of an account in bytes */
/** Get the combined filesize of an account in bytes */
public Integer getAccountFileSize(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "get_account_file_size", mapper.valueToTree(accountId));
}
@@ -160,22 +160,22 @@ public class Rpc {
return transport.callForResult(new TypeReference<ProviderInfo>(){}, "get_provider_info", mapper.valueToTree(accountId), mapper.valueToTree(email));
}
/* Checks if the context is already configured. */
/** Checks if the context is already configured. */
public Boolean isConfigured(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<Boolean>(){}, "is_configured", mapper.valueToTree(accountId));
}
/* Get system info for an account. */
/** Get system info for an account. */
public java.util.Map<String, String> getInfo(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<java.util.Map<String, String>>(){}, "get_info", mapper.valueToTree(accountId));
}
/* Get storage usage report as formatted string */
/** Get storage usage report as formatted string */
public String getStorageUsageReportString(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "get_storage_usage_report_string", mapper.valueToTree(accountId));
}
/* Get the blob dir. */
/** Get the blob dir. */
public String getBlobDir(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "get_blob_dir", mapper.valueToTree(accountId));
}
@@ -195,17 +195,17 @@ public class Rpc {
return transport.callForResult(new TypeReference<String>(){}, "get_migration_error", mapper.valueToTree(accountId));
}
/* Copy file to blob dir. */
/** Copy file to blob dir. */
public String copyToBlobDir(Integer accountId, String path) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "copy_to_blob_dir", mapper.valueToTree(accountId), mapper.valueToTree(path));
}
/* Sets the given configuration key. */
/** Sets the given configuration key. */
public void setConfig(Integer accountId, String key, String value) throws RpcException {
transport.call("set_config", mapper.valueToTree(accountId), mapper.valueToTree(key), mapper.valueToTree(value));
}
/* Updates a batch of configuration values. */
/** Updates a batch of configuration values. */
public void batchSetConfig(Integer accountId, java.util.Map<String, String> config) throws RpcException {
transport.call("batch_set_config", mapper.valueToTree(accountId), mapper.valueToTree(config));
}
@@ -225,7 +225,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<Qr>(){}, "check_qr", mapper.valueToTree(accountId), mapper.valueToTree(qrContent));
}
/* Returns configuration value for the given key. */
/** Returns configuration value for the given key. */
public String getConfig(Integer accountId, String key) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "get_config", mapper.valueToTree(accountId), mapper.valueToTree(key));
}
@@ -284,7 +284,7 @@ public class Rpc {
transport.call("add_or_update_transport", mapper.valueToTree(accountId), mapper.valueToTree(param));
}
/* Deprecated 2025-04. Alias for [Self::add_or_update_transport()]. */
/** Deprecated 2025-04. Alias for [Self::add_or_update_transport()]. */
public void addTransport(Integer accountId, EnteredLoginParam param) throws RpcException {
transport.call("add_transport", mapper.valueToTree(accountId), mapper.valueToTree(param));
}
@@ -315,7 +315,7 @@ public class Rpc {
transport.call("delete_transport", mapper.valueToTree(accountId), mapper.valueToTree(addr));
}
/* Signal an ongoing process to stop. */
/** Signal an ongoing process to stop. */
public void stopOngoingProcess(Integer accountId) throws RpcException {
transport.call("stop_ongoing_process", mapper.valueToTree(accountId));
}
@@ -608,7 +608,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<java.util.List<Integer>>(){}, "get_chat_contacts", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
/* Returns contact IDs of the past chat members. */
/** Returns contact IDs of the past chat members. */
public java.util.List<Integer> getPastChatContacts(Integer accountId, Integer chatId) throws RpcException {
return transport.callForResult(new TypeReference<java.util.List<Integer>>(){}, "get_past_chat_contacts", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
@@ -647,7 +647,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<Integer>(){}, "create_group_chat_unencrypted", mapper.valueToTree(accountId), mapper.valueToTree(name));
}
/* Deprecated 2025-07 in favor of create_broadcast(). */
/** Deprecated 2025-07 in favor of create_broadcast(). */
public Integer createBroadcastList(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "create_broadcast_list", mapper.valueToTree(accountId));
}
@@ -856,7 +856,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<java.util.Map<String, MessageLoadResult>>(){}, "get_messages", mapper.valueToTree(accountId), mapper.valueToTree(messageIds));
}
/* Fetch info desktop needs for creating a notification for a message */
/** Fetch info desktop needs for creating a notification for a message */
public MessageNotificationInfo getMessageNotificationInfo(Integer accountId, Integer messageId) throws RpcException {
return transport.callForResult(new TypeReference<MessageNotificationInfo>(){}, "get_message_notification_info", mapper.valueToTree(accountId), mapper.valueToTree(messageId));
}
@@ -888,12 +888,12 @@ public class Rpc {
return transport.callForResult(new TypeReference<String>(){}, "get_message_info", mapper.valueToTree(accountId), mapper.valueToTree(messageId));
}
/* Returns additional information for single message. */
/** Returns additional information for single message. */
public MessageInfo getMessageInfoObject(Integer accountId, Integer messageId) throws RpcException {
return transport.callForResult(new TypeReference<MessageInfo>(){}, "get_message_info_object", mapper.valueToTree(accountId), mapper.valueToTree(messageId));
}
/* Returns contacts that sent read receipts and the time of reading. */
/** Returns contacts that sent read receipts and the time of reading. */
public java.util.List<MessageReadReceipt> getMessageReadReceipts(Integer accountId, Integer messageId) throws RpcException {
return transport.callForResult(new TypeReference<java.util.List<MessageReadReceipt>>(){}, "get_message_read_receipts", mapper.valueToTree(accountId), mapper.valueToTree(messageId));
}
@@ -941,7 +941,7 @@ public class Rpc {
transport.call("save_msgs", mapper.valueToTree(accountId), mapper.valueToTree(messageIds));
}
/* Get a single contact options by ID. */
/** Get a single contact options by ID. */
public Contact getContact(Integer accountId, Integer contactId) throws RpcException {
return transport.callForResult(new TypeReference<Contact>(){}, "get_contact", mapper.valueToTree(accountId), mapper.valueToTree(contactId));
}
@@ -962,7 +962,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<Integer>(){}, "create_contact", mapper.valueToTree(accountId), mapper.valueToTree(email), mapper.valueToTree(name));
}
/* Returns contact id of the created or existing DM chat with that contact */
/** Returns contact id of the created or existing DM chat with that contact */
public Integer createChatByContactId(Integer accountId, Integer contactId) throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "create_chat_by_contact_id", mapper.valueToTree(accountId), mapper.valueToTree(contactId));
}
@@ -1011,7 +1011,7 @@ public class Rpc {
transport.call("delete_contact", mapper.valueToTree(accountId), mapper.valueToTree(contactId));
}
/* Sets display name for existing contact. */
/** Sets display name for existing contact. */
public void changeContactName(Integer accountId, Integer contactId, String name) throws RpcException {
transport.call("change_contact_name", mapper.valueToTree(accountId), mapper.valueToTree(contactId), mapper.valueToTree(name));
}
@@ -1046,7 +1046,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<Integer>(){}, "lookup_contact_id_by_addr", mapper.valueToTree(accountId), mapper.valueToTree(addr));
}
/* Parses a vCard file located at the given path. Returns contacts in their original order. */
/** Parses a vCard file located at the given path. Returns contacts in their original order. */
public java.util.List<VcardContact> parseVcard(String path) throws RpcException {
return transport.callForResult(new TypeReference<java.util.List<VcardContact>>(){}, "parse_vcard", mapper.valueToTree(path));
}
@@ -1069,12 +1069,12 @@ public class Rpc {
return transport.callForResult(new TypeReference<java.util.List<Integer>>(){}, "import_vcard_contents", mapper.valueToTree(accountId), mapper.valueToTree(vcard));
}
/* Returns a vCard containing contacts with the given ids. */
/** Returns a vCard containing contacts with the given ids. */
public String makeVcard(Integer accountId, java.util.List<Integer> contacts) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "make_vcard", mapper.valueToTree(accountId), mapper.valueToTree(contacts));
}
/* Sets vCard containing the given contacts to the message draft. */
/** Sets vCard containing the given contacts to the message draft. */
public void setDraftVcard(Integer accountId, Integer msgId, java.util.List<Integer> contacts) throws RpcException {
transport.call("set_draft_vcard", mapper.valueToTree(accountId), mapper.valueToTree(msgId), mapper.valueToTree(contacts));
}
@@ -1245,7 +1245,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<String>(){}, "get_webxdc_status_updates", mapper.valueToTree(accountId), mapper.valueToTree(instanceMsgId), mapper.valueToTree(lastKnownSerial));
}
/* Get info from a webxdc message */
/** Get info from a webxdc message */
public WebxdcMessageInfo getWebxdcInfo(Integer accountId, Integer instanceMsgId) throws RpcException {
return transport.callForResult(new TypeReference<WebxdcMessageInfo>(){}, "get_webxdc_info", mapper.valueToTree(accountId), mapper.valueToTree(instanceMsgId));
}
@@ -1285,27 +1285,27 @@ public class Rpc {
return transport.callForResult(new TypeReference<Integer>(){}, "init_webxdc_integration", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
/* Starts an outgoing call. */
/** Starts an outgoing call. */
public Integer placeOutgoingCall(Integer accountId, Integer chatId, String placeCallInfo) throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "place_outgoing_call", mapper.valueToTree(accountId), mapper.valueToTree(chatId), mapper.valueToTree(placeCallInfo));
}
/* Accepts an incoming call. */
/** Accepts an incoming call. */
public void acceptIncomingCall(Integer accountId, Integer msgId, String acceptCallInfo) throws RpcException {
transport.call("accept_incoming_call", mapper.valueToTree(accountId), mapper.valueToTree(msgId), mapper.valueToTree(acceptCallInfo));
}
/* Ends incoming or outgoing call. */
/** Ends incoming or outgoing call. */
public void endCall(Integer accountId, Integer msgId) throws RpcException {
transport.call("end_call", mapper.valueToTree(accountId), mapper.valueToTree(msgId));
}
/* Returns information about the call. */
/** Returns information about the call. */
public CallInfo callInfo(Integer accountId, Integer msgId) throws RpcException {
return transport.callForResult(new TypeReference<CallInfo>(){}, "call_info", mapper.valueToTree(accountId), mapper.valueToTree(msgId));
}
/* Returns JSON with ICE servers, to be used for WebRTC video calls. */
/** Returns JSON with ICE servers, to be used for WebRTC video calls. */
public String iceServers(Integer accountId) throws RpcException {
return transport.callForResult(new TypeReference<String>(){}, "ice_servers", mapper.valueToTree(accountId));
}
@@ -1361,7 +1361,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<Integer>(){}, "send_reaction", mapper.valueToTree(accountId), mapper.valueToTree(messageId), mapper.valueToTree(reaction));
}
/* Returns reactions to the message. */
/** Returns reactions to the message. */
public Reactions getMessageReactions(Integer accountId, Integer messageId) throws RpcException {
return transport.callForResult(new TypeReference<Reactions>(){}, "get_message_reactions", mapper.valueToTree(accountId), mapper.valueToTree(messageId));
}
@@ -1374,7 +1374,7 @@ public class Rpc {
transport.call("send_edit_request", mapper.valueToTree(accountId), mapper.valueToTree(msgId), mapper.valueToTree(newText));
}
/* Checks if messages can be sent to a given chat. */
/** Checks if messages can be sent to a given chat. */
public Boolean canSend(Integer accountId, Integer chatId) throws RpcException {
return transport.callForResult(new TypeReference<Boolean>(){}, "can_send", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
@@ -1392,7 +1392,7 @@ public class Rpc {
transport.call("remove_draft", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
/* Get draft for a chat, if any. */
/** Get draft for a chat, if any. */
public Message getDraft(Integer accountId, Integer chatId) throws RpcException {
return transport.callForResult(new TypeReference<Message>(){}, "get_draft", mapper.valueToTree(accountId), mapper.valueToTree(chatId));
}
@@ -1401,7 +1401,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<String>(){}, "misc_get_sticker_folder", mapper.valueToTree(accountId));
}
/* Saves a sticker to a collection/folder in the account's sticker folder. */
/** Saves a sticker to a collection/folder in the account's sticker folder. */
public void miscSaveSticker(Integer accountId, Integer msgId, String collection) throws RpcException {
transport.call("misc_save_sticker", mapper.valueToTree(accountId), mapper.valueToTree(msgId), mapper.valueToTree(collection));
}
@@ -1414,7 +1414,7 @@ public class Rpc {
return transport.callForResult(new TypeReference<java.util.Map<String, java.util.List<String>>>(){}, "misc_get_stickers", mapper.valueToTree(accountId));
}
/* Returns the messageid of the sent message */
/** Returns the messageid of the sent message */
public Integer miscSendTextMessage(Integer accountId, Integer chatId, String text) throws RpcException {
return transport.callForResult(new TypeReference<Integer>(){}, "misc_send_text_message", mapper.valueToTree(accountId), mapper.valueToTree(chatId), mapper.valueToTree(text));
}
@@ -18,7 +18,7 @@ public abstract class Account {
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String displayName;
public Integer id;
/* Optional tag as "Work", "Family". Meant to help profile owner to differ between profiles with similar names. */
/** Optional tag as "Work", "Family". Meant to help profile owner to differ between profiles with similar names. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String privateTag;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
@@ -2,7 +2,7 @@
package chat.delta.rpc.types;
public class CallInfo {
/* True if SDP offer has a video. */
/** True if SDP offer has a video. */
public Boolean hasVideo;
/**
* SDP offer.
@@ -19,21 +19,21 @@ public abstract class CallState {
public static class Alerting extends CallState {
}
/* Active call. */
/** Active call. */
public static class Active extends CallState {
}
/* Completed call that was once active and then was terminated for any reason. */
/** Completed call that was once active and then was terminated for any reason. */
public static class Completed extends CallState {
/* Call duration in seconds. */
/** Call duration in seconds. */
public Integer duration;
}
/* Incoming call that was not picked up within a timeout or was explicitly ended by the caller before we picked up. */
/** Incoming call that was not picked up within a timeout or was explicitly ended by the caller before we picked up. */
public static class Missed extends CallState {
}
/* Incoming call that was explicitly ended on our side before picking up or outgoing call that was declined before the timeout. */
/** Incoming call that was explicitly ended on our side before picking up or outgoing call that was declined before the timeout. */
public static class Declined extends CallState {
}
@@ -16,7 +16,7 @@ public abstract class ChatListItemFetchResult {
public String avatarPath;
public ChatType chatType;
public String color;
/* contact id if this is a dm chat (for view profile entry in context menu) */
/** contact id if this is a dm chat (for view profile entry in context menu) */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer dmChatContact;
public Integer freshMessageCounter;
@@ -36,7 +36,7 @@ public abstract class ChatListItemFetchResult {
* See also `is_key_contact` on `Contact`.
*/
public Boolean isEncrypted;
/* deprecated 2025-07, use chat_type instead */
/** deprecated 2025-07, use chat_type instead */
public Boolean isGroup;
public Boolean isMuted;
public Boolean isPinned;
@@ -50,7 +50,7 @@ public abstract class ChatListItemFetchResult {
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer lastUpdated;
public String name;
/* showing preview if last chat message is image */
/** showing preview if last chat message is image */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String summaryPreviewImage;
public Integer summaryStatus;
@@ -14,9 +14,9 @@ public class Contact {
public Boolean e2eeAvail;
public Integer id;
public Boolean isBlocked;
/* If the contact is a bot. */
/** If the contact is a bot. */
public Boolean isBot;
/* Is the contact a key contact. */
/** Is the contact a key contact. */
public Boolean isKeyContact;
/**
* True if the contact can be added to protected chats because SELF and contact have verified their fingerprints in both directions.
@@ -24,7 +24,7 @@ public class Contact {
* See [`Self::verifier_id`]/`Contact.verifierId` for a guidance how to display these information.
*/
public Boolean isVerified;
/* the contact's last seen timestamp */
/** the contact's last seen timestamp */
public Integer lastSeen;
public String name;
public String nameAndAddr;
@@ -2,12 +2,12 @@
package chat.delta.rpc.types;
public enum EnteredCertificateChecks {
/* `Automatic` means that provider database setting should be taken. If there is no provider database setting for certificate checks, check certificates strictly. */
/** `Automatic` means that provider database setting should be taken. If there is no provider database setting for certificate checks, check certificates strictly. */
automatic,
/* Ensure that TLS certificate is valid for the server hostname. */
/** Ensure that TLS certificate is valid for the server hostname. */
strict,
/* Accept certificates that are expired, self-signed or otherwise not valid for the server hostname. */
/** Accept certificates that are expired, self-signed or otherwise not valid for the server hostname. */
acceptInvalidCertificates,
}
@@ -7,27 +7,27 @@ package chat.delta.rpc.types;
* Usually it will be enough to only set `addr` and `password`, and all the other settings will be autoconfigured.
*/
public class EnteredLoginParam {
/* Email address. */
/** Email address. */
public String addr;
/* TLS options: whether to allow invalid certificates and/or invalid hostnames. Default: Automatic */
/** TLS options: whether to allow invalid certificates and/or invalid hostnames. Default: Automatic */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public EnteredCertificateChecks certificateChecks;
/* Imap server port. */
/** Imap server port. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer imapPort;
/* Imap socket security. */
/** Imap socket security. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Socket imapSecurity;
/* Imap server hostname or IP address. */
/** Imap server hostname or IP address. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String imapServer;
/* Imap username. */
/** Imap username. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String imapUser;
/* If true, login via OAUTH2 (not recommended anymore). Default: false */
/** If true, login via OAUTH2 (not recommended anymore). Default: false */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Boolean oauth2;
/* Password. */
/** Password. */
public String password;
/**
* SMTP Password.
@@ -36,16 +36,16 @@ public class EnteredLoginParam {
*/
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String smtpPassword;
/* SMTP server port. */
/** SMTP server port. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer smtpPort;
/* SMTP socket security. */
/** SMTP socket security. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Socket smtpSecurity;
/* SMTP server hostname or IP address. */
/** SMTP server hostname or IP address. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String smtpServer;
/* SMTP username. */
/** SMTP username. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String smtpUser;
}
@@ -11,11 +11,11 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
@JsonSubTypes({@Type(value = EphemeralTimer.Disabled.class, name="Disabled"), @Type(value = EphemeralTimer.Enabled.class, name="Enabled")})
public abstract class EphemeralTimer {
/* Timer is disabled. */
/** Timer is disabled. */
public static class Disabled extends EphemeralTimer {
}
/* Timer is enabled. */
/** Timer is enabled. */
public static class Enabled extends EphemeralTimer {
/**
* Timer duration in seconds.
@@ -2,8 +2,8 @@
package chat.delta.rpc.types;
public class Event {
/* Account ID. */
/** Account ID. */
public Integer contextId;
/* Event payload. */
/** Event payload. */
public EventType event;
}
@@ -20,41 +20,41 @@ public abstract class EventType {
public String msg;
}
/* Emitted when SMTP connection is established and login was successful. */
/** Emitted when SMTP connection is established and login was successful. */
public static class SmtpConnected extends EventType {
public String msg;
}
/* Emitted when IMAP connection is established and login was successful. */
/** Emitted when IMAP connection is established and login was successful. */
public static class ImapConnected extends EventType {
public String msg;
}
/* Emitted when a message was successfully sent to the SMTP server. */
/** Emitted when a message was successfully sent to the SMTP server. */
public static class SmtpMessageSent extends EventType {
public String msg;
}
/* Emitted when an IMAP message has been marked as deleted */
/** Emitted when an IMAP message has been marked as deleted */
public static class ImapMessageDeleted extends EventType {
public String msg;
}
/* Emitted when an IMAP message has been moved */
/** Emitted when an IMAP message has been moved */
public static class ImapMessageMoved extends EventType {
public String msg;
}
/* Emitted before going into IDLE on the Inbox folder. */
/** Emitted before going into IDLE on the Inbox folder. */
public static class ImapInboxIdle extends EventType {
}
/* Emitted when an new file in the $BLOBDIR was created */
/** Emitted when an new file in the $BLOBDIR was created */
public static class NewBlobFile extends EventType {
public String file;
}
/* Emitted when an file in the $BLOBDIR was deleted */
/** Emitted when an file in the $BLOBDIR was deleted */
public static class DeletedBlobFile extends EventType {
public String file;
}
@@ -79,26 +79,26 @@ public abstract class EventType {
public String msg;
}
/* An action cannot be performed because the user is not in the group. Reported eg. after a call to setChatName(), setChatProfileImage(), addContactToChat(), removeContactFromChat(), and messages sending functions. */
/** An action cannot be performed because the user is not in the group. Reported eg. after a call to setChatName(), setChatProfileImage(), addContactToChat(), removeContactFromChat(), and messages sending functions. */
public static class ErrorSelfNotInGroup extends EventType {
public String msg;
}
/* Messages or chats changed. One or more messages or chats changed for various reasons in the database: - Messages sent, received or removed - Chats created, deleted or archived - A draft has been set */
/** Messages or chats changed. One or more messages or chats changed for various reasons in the database: - Messages sent, received or removed - Chats created, deleted or archived - A draft has been set */
public static class MsgsChanged extends EventType {
/* Set if only a single chat is affected by the changes, otherwise 0. */
/** Set if only a single chat is affected by the changes, otherwise 0. */
public Integer chatId;
/* Set if only a single message is affected by the changes, otherwise 0. */
/** Set if only a single message is affected by the changes, otherwise 0. */
public Integer msgId;
}
/* Reactions for the message changed. */
/** Reactions for the message changed. */
public static class ReactionsChanged extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chatId;
/* ID of the contact whose reaction set is changed. */
/** ID of the contact whose reaction set is changed. */
public Integer contactId;
/* ID of the message for which reactions were changed. */
/** ID of the message for which reactions were changed. */
public Integer msgId;
}
@@ -108,28 +108,28 @@ public abstract class EventType {
* In addition to this event, ReactionsChanged is emitted.
*/
public static class IncomingReaction extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chatId;
/* ID of the contact whose reaction set is changed. */
/** ID of the contact whose reaction set is changed. */
public Integer contactId;
/* ID of the message for which reactions were changed. */
/** ID of the message for which reactions were changed. */
public Integer msgId;
/* The reaction. */
/** The reaction. */
public String reaction;
}
/* Incoming webxdc info or summary update, should be notified. */
/** Incoming webxdc info or summary update, should be notified. */
public static class IncomingWebxdcNotify extends EventType {
/* ID of the chat. */
/** ID of the chat. */
public Integer chatId;
/* ID of the contact sending. */
/** ID of the contact sending. */
public Integer contactId;
/* Link assigned to this notification, if any. */
/** Link assigned to this notification, if any. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String href;
/* ID of the added info message or webxdc instance in case of summary change. */
/** ID of the added info message or webxdc instance in case of summary change. */
public Integer msgId;
/* Text to notify. */
/** Text to notify. */
public String text;
}
@@ -139,42 +139,42 @@ public abstract class EventType {
* There is no extra #DC_EVENT_MSGS_CHANGED event sent together with this event.
*/
public static class IncomingMsg extends EventType {
/* ID of the chat where the message is assigned. */
/** ID of the chat where the message is assigned. */
public Integer chatId;
/* ID of the message. */
/** ID of the message. */
public Integer msgId;
}
/* Downloading a bunch of messages just finished. This is an event to allow the UI to only show one notification per message bunch, instead of cluttering the user with many notifications. */
/** Downloading a bunch of messages just finished. This is an event to allow the UI to only show one notification per message bunch, instead of cluttering the user with many notifications. */
public static class IncomingMsgBunch extends EventType {
}
/* Messages were seen or noticed. chat id is always set. */
/** Messages were seen or noticed. chat id is always set. */
public static class MsgsNoticed extends EventType {
public Integer chatId;
}
/* A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to DC_STATE_OUT_DELIVERED, see `Message.state`. */
/** A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to DC_STATE_OUT_DELIVERED, see `Message.state`. */
public static class MsgDelivered extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chatId;
/* ID of the message that was successfully sent. */
/** ID of the message that was successfully sent. */
public Integer msgId;
}
/* A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to DC_STATE_OUT_FAILED, see `Message.state`. */
/** A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to DC_STATE_OUT_FAILED, see `Message.state`. */
public static class MsgFailed extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chatId;
/* ID of the message that could not be sent. */
/** ID of the message that could not be sent. */
public Integer msgId;
}
/* A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to DC_STATE_OUT_MDN_RCVD, see `Message.state`. */
/** A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to DC_STATE_OUT_MDN_RCVD, see `Message.state`. */
public static class MsgRead extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chatId;
/* ID of the message that was read. */
/** ID of the message that was read. */
public Integer msgId;
}
@@ -188,9 +188,9 @@ public abstract class EventType {
* This event does not indicate the message deletion from the server.
*/
public static class MsgDeleted extends EventType {
/* ID of the chat where the message was prior to deletion. Never 0. */
/** ID of the chat where the message was prior to deletion. Never 0. */
public Integer chatId;
/* ID of the deleted message. Never 0. */
/** ID of the deleted message. Never 0. */
public Integer msgId;
}
@@ -203,37 +203,37 @@ public abstract class EventType {
public Integer chatId;
}
/* Chat ephemeral timer changed. */
/** Chat ephemeral timer changed. */
public static class ChatEphemeralTimerModified extends EventType {
/* Chat ID. */
/** Chat ID. */
public Integer chatId;
/* New ephemeral timer value. */
/** New ephemeral timer value. */
public Integer timer;
}
/* Chat deleted. */
/** Chat deleted. */
public static class ChatDeleted extends EventType {
/* Chat ID. */
/** Chat ID. */
public Integer chat_id;
}
/* Contact(s) created, renamed, blocked or deleted. */
/** Contact(s) created, renamed, blocked or deleted. */
public static class ContactsChanged extends EventType {
/* If set, this is the contact_id of an added contact that should be selected. */
/** If set, this is the contact_id of an added contact that should be selected. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer contactId;
}
/* Location of one or more contact has changed. */
/** Location of one or more contact has changed. */
public static class LocationChanged extends EventType {
/* contact_id of the contact for which the location has changed. If the locations of several contacts have been changed, this parameter is set to `None`. */
/** contact_id of the contact for which the location has changed. If the locations of several contacts have been changed, this parameter is set to `None`. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer contactId;
}
/* Inform about the configuration progress started by configure(). */
/** Inform about the configuration progress started by configure(). */
public static class ConfigureProgress extends EventType {
/* Progress comment or error, something to display to the user. */
/** Progress comment or error, something to display to the user. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String comment;
/**
@@ -244,9 +244,9 @@ public abstract class EventType {
public Integer progress;
}
/* Inform about the import/export progress started by imex(). */
/** Inform about the import/export progress started by imex(). */
public static class ImexProgress extends EventType {
/* 0=error, 1-999=progress in permille, 1000=success and done */
/** 0=error, 1-999=progress in permille, 1000=success and done */
public Integer progress;
}
@@ -267,62 +267,62 @@ public abstract class EventType {
* These events are typically sent after a joiner has scanned the QR code generated by getChatSecurejoinQrCodeSvg().
*/
public static class SecurejoinInviterProgress extends EventType {
/* ID of the chat in case of success. */
/** ID of the chat in case of success. */
public Integer chatId;
/* The type of the joined chat. This can take the same values as `BasicChat.chatType` ([`crate::api::types::chat::BasicChat::chat_type`]). */
/** The type of the joined chat. This can take the same values as `BasicChat.chatType` ([`crate::api::types::chat::BasicChat::chat_type`]). */
public ChatType chatType;
/* ID of the contact that wants to join. */
/** ID of the contact that wants to join. */
public Integer contactId;
/* Progress, always 1000. */
/** Progress, always 1000. */
public Integer progress;
}
/* Progress information of a secure-join handshake from the view of the joiner (Bob, the person who scans the QR code). The events are typically sent while secureJoin(), which may take some time, is executed. */
/** Progress information of a secure-join handshake from the view of the joiner (Bob, the person who scans the QR code). The events are typically sent while secureJoin(), which may take some time, is executed. */
public static class SecurejoinJoinerProgress extends EventType {
/* ID of the inviting contact. */
/** ID of the inviting contact. */
public Integer contactId;
/* Progress as: 400=vg-/vc-request-with-auth sent, typically shown as "alice@addr verified, introducing myself." (Bob has verified alice and waits until Alice does the same for him) 1000=vg-member-added/vc-contact-confirm received */
/** Progress as: 400=vg-/vc-request-with-auth sent, typically shown as "alice@addr verified, introducing myself." (Bob has verified alice and waits until Alice does the same for him) 1000=vg-member-added/vc-contact-confirm received */
public Integer progress;
}
/* The connectivity to the server changed. This means that you should refresh the connectivity view and possibly the connectivtiy HTML; see getConnectivity() and getConnectivityHtml() for details. */
/** The connectivity to the server changed. This means that you should refresh the connectivity view and possibly the connectivtiy HTML; see getConnectivity() and getConnectivityHtml() for details. */
public static class ConnectivityChanged extends EventType {
}
/* Deprecated by `ConfigSynced`. */
/** Deprecated by `ConfigSynced`. */
public static class SelfavatarChanged extends EventType {
}
/* A multi-device synced config value changed. Maybe the app needs to refresh smth. For uniformity this is emitted on the source device too. The value isn't here, otherwise it would be logged which might not be good for privacy. */
/** A multi-device synced config value changed. Maybe the app needs to refresh smth. For uniformity this is emitted on the source device too. The value isn't here, otherwise it would be logged which might not be good for privacy. */
public static class ConfigSynced extends EventType {
/* Configuration key. */
/** Configuration key. */
public String key;
}
public static class WebxdcStatusUpdate extends EventType {
/* Message ID. */
/** Message ID. */
public Integer msgId;
/* Status update ID. */
/** Status update ID. */
public Integer statusUpdateSerial;
}
/* Data received over an ephemeral peer channel. */
/** Data received over an ephemeral peer channel. */
public static class WebxdcRealtimeData extends EventType {
/* Realtime data. */
/** Realtime data. */
public java.util.List<Integer> data;
/* Message ID. */
/** Message ID. */
public Integer msgId;
}
/* Advertisement received over an ephemeral peer channel. This can be used by bots to initiate peer-to-peer communication from their side. */
/** Advertisement received over an ephemeral peer channel. This can be used by bots to initiate peer-to-peer communication from their side. */
public static class WebxdcRealtimeAdvertisementReceived extends EventType {
/* Message ID of the webxdc instance. */
/** Message ID of the webxdc instance. */
public Integer msgId;
}
/* Inform that a message containing a webxdc instance has been deleted */
/** Inform that a message containing a webxdc instance has been deleted */
public static class WebxdcInstanceDeleted extends EventType {
/* ID of the deleted message. */
/** ID of the deleted message. */
public Integer msgId;
}
@@ -342,9 +342,9 @@ public abstract class EventType {
public static class ChatlistChanged extends EventType {
}
/* Inform that a single chat list item changed and needs to be rerendered. If `chat_id` is set to None, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache. */
/** Inform that a single chat list item changed and needs to be rerendered. If `chat_id` is set to None, then all currently visible chats need to be rerendered, and all not-visible items need to be cleared from cache if the UI has a cache. */
public static class ChatlistItemChanged extends EventType {
/* ID of the changed chat */
/** ID of the changed chat */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer chatId;
}
@@ -365,47 +365,47 @@ public abstract class EventType {
public static class AccountsItemChanged extends EventType {
}
/* Inform than some events have been skipped due to event channel overflow. */
/** Inform than some events have been skipped due to event channel overflow. */
public static class EventChannelOverflow extends EventType {
/* Number of events skipped. */
/** Number of events skipped. */
public Integer n;
}
/* Incoming call. */
/** Incoming call. */
public static class IncomingCall extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chat_id;
/* True if incoming call is a video call. */
/** True if incoming call is a video call. */
public Boolean has_video;
/* ID of the info message referring to the call. */
/** ID of the info message referring to the call. */
public Integer msg_id;
/* User-defined info as passed to place_outgoing_call() */
/** User-defined info as passed to place_outgoing_call() */
public String place_call_info;
}
/* Incoming call accepted. This is esp. interesting to stop ringing on other devices. */
/** Incoming call accepted. This is esp. interesting to stop ringing on other devices. */
public static class IncomingCallAccepted extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chat_id;
/* ID of the info message referring to the call. */
/** ID of the info message referring to the call. */
public Integer msg_id;
}
/* Outgoing call accepted. */
/** Outgoing call accepted. */
public static class OutgoingCallAccepted extends EventType {
/* User-defined info passed to dc_accept_incoming_call( */
/** User-defined info passed to dc_accept_incoming_call( */
public String accept_call_info;
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chat_id;
/* ID of the info message referring to the call. */
/** ID of the info message referring to the call. */
public Integer msg_id;
}
/* Call ended. */
/** Call ended. */
public static class CallEnded extends EventType {
/* ID of the chat which the message belongs to. */
/** ID of the chat which the message belongs to. */
public Integer chat_id;
/* ID of the info message referring to the call. */
/** ID of the info message referring to the call. */
public Integer msg_id;
}
@@ -31,12 +31,12 @@ public class FullChat {
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String mailingListAddress;
public String name;
/* Contact IDs of the past chat members. */
/** Contact IDs of the past chat members. */
public java.util.List<Integer> pastContactIds;
public Boolean pinned;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String profileImage;
/* Note that this is different from [`ChatListItem::is_self_in_group`](`crate::api::types::chat_list::ChatListItemFetchResult::ChatListItem::is_self_in_group`). This property should only be accessed when [`FullChat::chat_type`] is [`Chattype::Group`]. */
/** Note that this is different from [`ChatListItem::is_self_in_group`](`crate::api::types::chat_list::ChatListItemFetchResult::ChatListItem::is_self_in_group`). This property should only be accessed when [`FullChat::chat_type`] is [`Chattype::Group`]. */
public Boolean selfInGroup;
public Boolean wasSeenRecently;
}
@@ -2,12 +2,12 @@
package chat.delta.rpc.types;
public class HttpResponse {
/* base64-encoded response body. */
/** base64-encoded response body. */
public String blob;
/* Encoding, e.g. "utf-8". */
/** Encoding, e.g. "utf-8". */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String encoding;
/* MIME type, e.g. "text/plain" or "text/html". */
/** MIME type, e.g. "text/plain" or "text/html". */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String mimetype;
}
@@ -7,7 +7,7 @@ public class Message {
public Integer dimensionsWidth;
public DownloadState downloadState;
public Integer duration;
/* An error text, if there is one. */
/** An error text, if there is one. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String error;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
@@ -20,13 +20,13 @@ public class Message {
public Integer fromId;
public Boolean hasDeviatingTimestamp;
public Boolean hasHtml;
/* Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
/** Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
public Boolean hasLocation;
public Integer id;
/* if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
/** if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer infoContactId;
/* True if the message was sent by a bot. */
/** True if the message was sent by a bot. */
public Boolean isBot;
public Boolean isEdited;
public Boolean isForwarded;
@@ -57,7 +57,7 @@ public class Message {
public Integer sortTimestamp;
public Integer state;
public String subject;
/* when is_info is true this describes what type of system message it is */
/** when is_info is true this describes what type of system message it is */
public SystemMessageType systemMessageType;
public String text;
public Integer timestamp;
@@ -12,7 +12,7 @@ public class MessageData {
public Pair<Float, Float> location;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String overrideSenderName;
/* Quoted message id. Takes preference over `quoted_text` (see below). */
/** Quoted message id. Takes preference over `quoted_text` (see below). */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer quotedMessageId;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
@@ -3,7 +3,7 @@ package chat.delta.rpc.types;
public class MessageInfo {
public EphemeralTimer ephemeralTimer;
/* When message is ephemeral this contains the timestamp of the message expiry */
/** When message is ephemeral this contains the timestamp of the message expiry */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer ephemeralTimestamp;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
@@ -15,9 +15,9 @@ public abstract class MessageListItem {
public Integer msg_id;
}
/* Day marker, separating messages that correspond to different days according to local time. */
/** Day marker, separating messages that correspond to different days according to local time. */
public static class DayMarker extends MessageListItem {
/* Marker timestamp, for day markers, in unix milliseconds */
/** Marker timestamp, for day markers, in unix milliseconds */
public Integer timestamp;
}
@@ -17,7 +17,7 @@ public abstract class MessageLoadResult {
public Integer dimensionsWidth;
public DownloadState downloadState;
public Integer duration;
/* An error text, if there is one. */
/** An error text, if there is one. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String error;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
@@ -30,13 +30,13 @@ public abstract class MessageLoadResult {
public Integer fromId;
public Boolean hasDeviatingTimestamp;
public Boolean hasHtml;
/* Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
/** Check if a message has a POI location bound to it. These locations are also returned by `get_locations` method. The UI may decide to display a special icon beside such messages. */
public Boolean hasLocation;
public Integer id;
/* if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
/** if is_info is set, this refers to the contact profile that should be opened when the info message is tapped. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer infoContactId;
/* True if the message was sent by a bot. */
/** True if the message was sent by a bot. */
public Boolean isBot;
public Boolean isEdited;
public Boolean isForwarded;
@@ -67,7 +67,7 @@ public abstract class MessageLoadResult {
public Integer sortTimestamp;
public Integer state;
public String subject;
/* when is_info is true this describes what type of system message it is */
/** when is_info is true this describes what type of system message it is */
public SystemMessageType systemMessageType;
public String text;
public Integer timestamp;
@@ -12,9 +12,9 @@ public class MessageNotificationInfo {
public String image;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String imageMimeType;
/* also known as summary_text1 */
/** also known as summary_text1 */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String summaryPrefix;
/* also known as summary_text2 */
/** also known as summary_text2 */
public String summaryText;
}
@@ -18,7 +18,7 @@ public abstract class MessageQuote {
public static class WithMessage extends MessageQuote {
public String authorDisplayColor;
public String authorDisplayName;
/* The quoted message does not always belong to the same chat, e.g. when "Reply Privately" is used. */
/** The quoted message does not always belong to the same chat, e.g. when "Reply Privately" is used. */
public Integer chatId;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String image;
@@ -4,7 +4,7 @@ package chat.delta.rpc.types;
public class MessageSearchResult {
public String authorColor;
public Integer authorId;
/* if sender name if overridden it will show it as ~alias */
/** if sender name if overridden it will show it as ~alias */
public String authorName;
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String authorProfileImage;
@@ -2,12 +2,12 @@
package chat.delta.rpc.types;
public enum NotifyState {
/* Not subscribed to push notifications. */
/** Not subscribed to push notifications. */
NotConnected,
/* Subscribed to heartbeat push notifications. */
/** Subscribed to heartbeat push notifications. */
Heartbeat,
/* Subscribed to push notifications for new messages. */
/** Subscribed to push notifications for new messages. */
Connected,
}
@@ -3,7 +3,7 @@ package chat.delta.rpc.types;
public class ProviderInfo {
public String beforeLoginHint;
/* Unique ID, corresponding to provider database filename. */
/** Unique ID, corresponding to provider database filename. */
public String id;
public String overviewPage;
public Integer status;
+71 -71
View File
@@ -17,45 +17,45 @@ public abstract class Qr {
* If the user agrees, pass this QR code to [`crate::securejoin::join_securejoin`].
*/
public static class AskVerifyContact extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* ID of the contact. */
/** ID of the contact. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user whether to join the group. */
/** Ask the user whether to join the group. */
public static class AskVerifyGroup extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* ID of the contact. */
/** ID of the contact. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Group ID. */
/** Group ID. */
public String grpid;
/* Group name. */
/** Group name. */
public String grpname;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user whether to join the broadcast channel. */
/** Ask the user whether to join the broadcast channel. */
public static class AskJoinBroadcast extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* ID of the contact who owns the broadcast channel and created the QR code. */
/** ID of the contact who owns the broadcast channel and created the QR code. */
public Integer contact_id;
/* Fingerprint of the broadcast channel owner's key as scanned from the QR code. */
/** Fingerprint of the broadcast channel owner's key as scanned from the QR code. */
public String fingerprint;
/* A string of random characters, uniquely identifying this broadcast channel across all databases/clients. Called `grpid` for historic reasons: The id of multi-user chats is always called `grpid` in the database because groups were once the only multi-user chats. */
/** A string of random characters, uniquely identifying this broadcast channel across all databases/clients. Called `grpid` for historic reasons: The id of multi-user chats is always called `grpid` in the database because groups were once the only multi-user chats. */
public String grpid;
/* Invite number. */
/** Invite number. */
public String invitenumber;
/* The user-visible name of this broadcast channel */
/** The user-visible name of this broadcast channel */
public String name;
}
@@ -65,41 +65,41 @@ public abstract class Qr {
* Ask the user if they want to start chatting.
*/
public static class FprOk extends Qr {
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
}
/* Scanned fingerprint does not match the last seen fingerprint. */
/** Scanned fingerprint does not match the last seen fingerprint. */
public static class FprMismatch extends Qr {
/* Contact ID. */
/** Contact ID. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer contact_id;
}
/* The scanned QR code contains a fingerprint but no e-mail address. */
/** The scanned QR code contains a fingerprint but no e-mail address. */
public static class FprWithoutAddr extends Qr {
/* Key fingerprint. */
/** Key fingerprint. */
public String fingerprint;
}
/* Ask the user if they want to create an account on the given domain. */
/** Ask the user if they want to create an account on the given domain. */
public static class Account extends Qr {
/* Server domain name. */
/** Server domain name. */
public String domain;
}
/* Provides a backup that can be retrieved using iroh-net based backup transfer protocol. */
/** Provides a backup that can be retrieved using iroh-net based backup transfer protocol. */
public static class Backup2 extends Qr {
/* Authentication token. */
/** Authentication token. */
public String auth_token;
/* Iroh node address. */
/** Iroh node address. */
public String node_addr;
}
public static class BackupTooNew extends Qr {
}
/* Ask the user if they want to use the given service for video chats. */
/** Ask the user if they want to use the given service for video chats. */
public static class WebrtcInstance extends Qr {
public String domain;
public String instance_pattern;
@@ -111,9 +111,9 @@ public abstract class Qr {
* Note that HTTP(S) URLs without a path and query parameters are treated as HTTP(S) proxy URL. UI may want to still offer to open the URL in the browser if QR code contents starts with `http://` or `https://` and the QR code was not scanned from the proxy configuration screen.
*/
public static class Proxy extends Qr {
/* Host extracted from the URL to display in the UI. */
/** Host extracted from the URL to display in the UI. */
public String host;
/* Port extracted from the URL to display in the UI. */
/** Port extracted from the URL to display in the UI. */
public Integer port;
/**
* Proxy URL.
@@ -129,9 +129,9 @@ public abstract class Qr {
* Optionally, a draft message could be provided. Ask the user if they want to start chatting.
*/
public static class Addr extends Qr {
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
/* Draft message. */
/** Draft message. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String draft;
}
@@ -154,91 +154,91 @@ public abstract class Qr {
public String text;
}
/* Ask the user if they want to withdraw their own QR code. */
/** Ask the user if they want to withdraw their own QR code. */
public static class WithdrawVerifyContact extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user if they want to withdraw their own group invite QR code. */
/** Ask the user if they want to withdraw their own group invite QR code. */
public static class WithdrawVerifyGroup extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Group ID. */
/** Group ID. */
public String grpid;
/* Group name. */
/** Group name. */
public String grpname;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user if they want to withdraw their own broadcast channel invite QR code. */
/** Ask the user if they want to withdraw their own broadcast channel invite QR code. */
public static class WithdrawJoinBroadcast extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. Always `ContactId::SELF`. */
/** Contact ID. Always `ContactId::SELF`. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* ID, uniquely identifying this chat. Called grpid for historic reasons. */
/** ID, uniquely identifying this chat. Called grpid for historic reasons. */
public String grpid;
/* Invite number. */
/** Invite number. */
public String invitenumber;
/* Broadcast name. */
/** Broadcast name. */
public String name;
}
/* Ask the user if they want to revive their own QR code. */
/** Ask the user if they want to revive their own QR code. */
public static class ReviveVerifyContact extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user if they want to revive their own group invite QR code. */
/** Ask the user if they want to revive their own group invite QR code. */
public static class ReviveVerifyGroup extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. */
/** Contact ID. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Group ID. */
/** Group ID. */
public String grpid;
/* Contact ID. */
/** Contact ID. */
public String grpname;
/* Invite number. */
/** Invite number. */
public String invitenumber;
}
/* Ask the user if they want to revive their own broadcast channel invite QR code. */
/** Ask the user if they want to revive their own broadcast channel invite QR code. */
public static class ReviveJoinBroadcast extends Qr {
/* Authentication code. */
/** Authentication code. */
public String authcode;
/* Contact ID. Always `ContactId::SELF`. */
/** Contact ID. Always `ContactId::SELF`. */
public Integer contact_id;
/* Fingerprint of the contact key as scanned from the QR code. */
/** Fingerprint of the contact key as scanned from the QR code. */
public String fingerprint;
/* Globally unique chat ID. Called grpid for historic reasons. */
/** Globally unique chat ID. Called grpid for historic reasons. */
public String grpid;
/* Invite number. */
/** Invite number. */
public String invitenumber;
/* Broadcast name. */
/** Broadcast name. */
public String name;
}
@@ -1,12 +1,12 @@
/* Autogenerated file, do not edit manually */
package chat.delta.rpc.types;
/* A single reaction emoji. */
/** A single reaction emoji. */
public class Reaction {
/* Emoji frequency. */
/** Emoji frequency. */
public Integer count;
/* Emoji. */
/** Emoji. */
public String emoji;
/* True if we reacted with this emoji. */
/** True if we reacted with this emoji. */
public Boolean isFromSelf;
}
@@ -1,10 +1,10 @@
/* Autogenerated file, do not edit manually */
package chat.delta.rpc.types;
/* Structure representing all reactions to a particular message. */
/** Structure representing all reactions to a particular message. */
public class Reactions {
/* Unique reactions and their count, sorted in descending order. */
/** Unique reactions and their count, sorted in descending order. */
public java.util.List<Reaction> reactions;
/* Map from a contact to it's reaction to message. */
/** Map from a contact to it's reaction to message. */
public java.util.Map<String, java.util.List<String>> reactionsByContact;
}
@@ -2,21 +2,21 @@
package chat.delta.rpc.types;
public enum SecurejoinSource {
/* Because of some problem, it is unknown where the QR code came from. */
/** Because of some problem, it is unknown where the QR code came from. */
Unknown,
/* The user opened a link somewhere outside Delta Chat */
/** The user opened a link somewhere outside Delta Chat */
ExternalLink,
/* The user clicked on a link in a message inside Delta Chat */
/** The user clicked on a link in a message inside Delta Chat */
InternalLink,
/* The user clicked "Paste from Clipboard" in the QR scan activity */
/** The user clicked "Paste from Clipboard" in the QR scan activity */
Clipboard,
/* The user clicked "Load QR code as image" in the QR scan activity */
/** The user clicked "Load QR code as image" in the QR scan activity */
ImageLoaded,
/* The user scanned a QR code */
/** The user scanned a QR code */
Scan,
}
@@ -2,12 +2,12 @@
package chat.delta.rpc.types;
public enum SecurejoinUiPath {
/* The UI path is unknown, or the user didn't open the QR code screen at all. */
/** The UI path is unknown, or the user didn't open the QR code screen at all. */
Unknown,
/* The user directly clicked on the QR icon in the main screen */
/** The user directly clicked on the QR icon in the main screen */
QrIcon,
/* The user first clicked on the `+` button in the main screen, and then on "New Contact" */
/** The user first clicked on the `+` button in the main screen, and then on "New Contact" */
NewContact,
}
@@ -2,15 +2,15 @@
package chat.delta.rpc.types;
public enum Socket {
/* Unspecified socket security, select automatically. */
/** Unspecified socket security, select automatically. */
automatic,
/* TLS connection. */
/** TLS connection. */
ssl,
/* STARTTLS connection. */
/** STARTTLS connection. */
starttls,
/* No TLS, plaintext connection. */
/** No TLS, plaintext connection. */
plain,
}
@@ -19,21 +19,21 @@ public enum SystemMessageType {
CallAccepted,
CallEnded,
/* 1:1 chats info message telling that SecureJoin has started and the user should wait for it to complete. */
/** 1:1 chats info message telling that SecureJoin has started and the user should wait for it to complete. */
SecurejoinWait,
/* 1:1 chats info message telling that SecureJoin is still running, but the user may already send messages. */
/** 1:1 chats info message telling that SecureJoin is still running, but the user may already send messages. */
SecurejoinWaitTimeout,
/* Chat ephemeral message timer is changed. */
/** Chat ephemeral message timer is changed. */
EphemeralTimerChanged,
/* Self-sent-message that contains only json used for multi-device-sync; if possible, we attach that to other messages as for locations. */
/** Self-sent-message that contains only json used for multi-device-sync; if possible, we attach that to other messages as for locations. */
MultiDeviceSync,
/* Webxdc info added with `info` set in `send_webxdc_status_update()`. */
/** Webxdc info added with `info` set in `send_webxdc_status_update()`. */
WebxdcInfoMessage,
/* This message contains a users iroh node address. */
/** This message contains a users iroh node address. */
IrohNodeAddr,
}
@@ -2,19 +2,19 @@
package chat.delta.rpc.types;
public class VcardContact {
/* Email address. */
/** Email address. */
public String addr;
/* Contact color as hex string. */
/** Contact color as hex string. */
public String color;
/* The contact's name, or the email address if no name was given. */
/** The contact's name, or the email address if no name was given. */
public String displayName;
/* Public PGP key in Base64. */
/** Public PGP key in Base64. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String key;
/* Profile image in Base64. */
/** Profile image in Base64. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String profileImage;
/* Last update timestamp. */
/** Last update timestamp. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public Integer timestamp;
}
@@ -4,13 +4,13 @@ package chat.delta.rpc.types;
public enum Viewtype {
Unknown,
/* Text message. */
/** Text message. */
Text,
/* Image message. If the image is an animated GIF, the type `Viewtype.Gif` should be used. */
/** Image message. If the image is an animated GIF, the type `Viewtype.Gif` should be used. */
Image,
/* Animated GIF message. */
/** Animated GIF message. */
Gif,
/**
@@ -20,24 +20,24 @@ public enum Viewtype {
*/
Sticker,
/* Message containing an Audio file. */
/** Message containing an Audio file. */
Audio,
/* A voice message that was directly recorded by the user. For all other audio messages, the type `Viewtype.Audio` should be used. */
/** A voice message that was directly recorded by the user. For all other audio messages, the type `Viewtype.Audio` should be used. */
Voice,
/* Video messages. */
/** Video messages. */
Video,
/* Message containing any file, eg. a PDF. */
/** Message containing any file, eg. a PDF. */
File,
/* Message is a call. */
/** Message is a call. */
Call,
/* Message is an webxdc instance. */
/** Message is an webxdc instance. */
Webxdc,
/* Message containing shared contacts represented as a vCard (virtual contact file) with email addresses and possibly other fields. Use `parse_vcard()` to retrieve them. */
/** Message containing shared contacts represented as a vCard (virtual contact file) with email addresses and possibly other fields. Use `parse_vcard()` to retrieve them. */
Vcard,
}
@@ -2,7 +2,7 @@
package chat.delta.rpc.types;
public class WebxdcMessageInfo {
/* if the Webxdc represents a document, then this is the name of the document */
/** if the Webxdc represents a document, then this is the name of the document */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String document;
/**
@@ -13,7 +13,7 @@ public class WebxdcMessageInfo {
* App icons should should be square, the implementations will add round corners etc. as needed.
*/
public String icon;
/* True if full internet access should be granted to the app. */
/** True if full internet access should be granted to the app. */
public Boolean internetAccess;
/**
* The name of the app.
@@ -21,16 +21,16 @@ public class WebxdcMessageInfo {
* Defaults to the filename if not set in the manifest.
*/
public String name;
/* Address to be used for `window.webxdc.selfAddr` in JS land. */
/** Address to be used for `window.webxdc.selfAddr` in JS land. */
public String selfAddr;
/* Milliseconds to wait before calling `sendUpdate()` again since the last call. Should be exposed to `window.sendUpdateInterval` in JS land. */
/** Milliseconds to wait before calling `sendUpdate()` again since the last call. Should be exposed to `window.sendUpdateInterval` in JS land. */
public Integer sendUpdateInterval;
/* Maximum number of bytes accepted for a serialized update object. Should be exposed to `window.sendUpdateMaxSize` in JS land. */
/** Maximum number of bytes accepted for a serialized update object. Should be exposed to `window.sendUpdateMaxSize` in JS land. */
public Integer sendUpdateMaxSize;
/* URL where the source code of the Webxdc and other information can be found; defaults to an empty string. Implementations may offer an menu or a button to open this URL. */
/** URL where the source code of the Webxdc and other information can be found; defaults to an empty string. Implementations may offer an menu or a button to open this URL. */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String sourceCodeUrl;
/* short string describing the state of the app, sth. as "2 votes", "Highscore: 123", can be changed by the apps */
/** short string describing the state of the app, sth. as "2 votes", "Highscore: 123", can be changed by the apps */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String summary;
}
@@ -89,7 +89,9 @@ public class ApplicationContext extends MultiDexApplication {
System.loadLibrary("native-utils");
dcAccounts = new DcAccounts(new File(getFilesDir(), "accounts").getAbsolutePath());
Log.i(TAG, "DcAccounts created");
rpc = new Rpc(new FFITransport(dcAccounts.getJsonrpcInstance()));
Log.i(TAG, "Rpc created");
AccountManager.getInstance().migrateToDcAccounts(this);
// October-2025 migration: delete deprecated "permanent channel" id
@@ -98,6 +100,7 @@ public class ApplicationContext extends MultiDexApplication {
// end October-2025 migration
int[] allAccounts = dcAccounts.getAll();
Log.i(TAG, "Number of profiles: " + allAccounts.length);
for (int accountId : allAccounts) {
DcContext ac = dcAccounts.getAccount(accountId);
if (!ac.isOpen()) {
@@ -131,7 +134,9 @@ public class ApplicationContext extends MultiDexApplication {
notificationCenter = new NotificationCenter(this);
eventCenter = new DcEventCenter(this);
new Thread(() -> {
Log.i(TAG, "Starting event loop");
DcEventEmitter emitter = dcAccounts.getEventEmitter();
Log.i(TAG, "DcEventEmitter obtained");
while (true) {
DcEvent event = emitter.getNextEvent();
if (event==null) {
@@ -37,8 +37,8 @@ public abstract class BaseActionBarActivity extends AppCompatActivity {
onPreCreate();
super.onCreate(savedInstanceState);
// Only enable Edge-to-Edge on API 30+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Only enable Edge-to-Edge if it is well supported
if (ViewUtil.isEdgeToEdgeSupported()) {
// docs says to use: WindowCompat.enableEdgeToEdge(getWindow());
// but it actually makes things worse, the next takes care of setting the 3-buttons navigation bar background
EdgeToEdge.enable(this);
@@ -873,6 +873,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
if (!ViewUtil.isEdgeToEdgeSupported()) {
// since insets will not be applied, we need to set top padding to avoid drawing behind toolbar
try (TypedArray typedArray = obtainStyledAttributes(new int[]{android.R.attr.actionBarSize})) {
int paddingTop = typedArray.getDimensionPixelSize(0, 0);
container.setPadding(container.getPaddingLeft(), paddingTop, container.getPaddingRight() , container.getPaddingBottom());
}
}
// apply padding top to avoid drawing behind top bar
ViewUtil.applyWindowInsets(findViewById(R.id.fragment_content), false, true, false, false);
// apply padding to root to avoid collision with system bars
@@ -50,6 +50,7 @@ import org.thoughtcrime.securesms.profiles.AvatarHelper;
import org.thoughtcrime.securesms.proxy.ProxySettingsActivity;
import org.thoughtcrime.securesms.qr.RegistrationQrActivity;
import org.thoughtcrime.securesms.relay.EditRelayActivity;
import org.thoughtcrime.securesms.relay.RelayListActivity;
import org.thoughtcrime.securesms.scribbles.ScribbleActivity;
import org.thoughtcrime.securesms.util.IntentUtils;
import org.thoughtcrime.securesms.util.Prefs;
@@ -73,7 +74,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
private static final String INSTANCES_URL = "https://chatmail.at/relays";
private static final String DEFAULT_CHATMAIL_HOST = "nine.testrun.org";
public static final String QR_ACCOUNT_EXTRA = "qr_account_extra";
public static final String FROM_WELCOME = "from_welcome";
private static final int REQUEST_CODE_AVATAR = 1;
@@ -106,11 +106,22 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
boolean fromWelcome = getIntent().getBooleanExtra(FROM_WELCOME, false);
if (DcHelper.getContext(this).isConfigured() == 1) {
// if account is configured it means we didn't come from Welcome screen nor from QR scanner,
// instead, user clicked a dcaccount:// URI directly, so we need to switch to a new account:
// instead, user clicked a dcaccount:// URI directly, so we need to just offer to add a new relay
Uri uri = getIntent().getData();
if (uri != null) {
Intent intent = new Intent(this, RelayListActivity.class);
intent.putExtra(RelayListActivity.EXTRA_QR_DATA, uri.toString());
startActivity(intent);
finish();
return;
}
// if URI is unexpectedly null, then fallback to new profile creation
AccountManager.getInstance().beginAccountCreation(this);
}
getOnBackPressedDispatcher().addCallback(this, new OnBackPressedCallback(!fromWelcome) {
@Override
public void handleOnBackPressed() {
@@ -231,16 +242,6 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
Permissions.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
}
@Override
public void onStart() {
super.onStart();
String accountQr = getIntent().getStringExtra(QR_ACCOUNT_EXTRA);
if (accountQr != null) {
getIntent().removeExtra(QR_ACCOUNT_EXTRA);
setProviderFromQr(accountQr);
}
}
@Override
protected void onPause() {
super.onPause();
@@ -102,6 +102,8 @@ public class WebViewActivity extends PassphraseRequiredActionBarActivity
case "mailto":
case "openpgp4fpr":
case "geo":
case "dcaccount":
case "dclogin":
return openOnlineUrl(url);
}
}
@@ -152,14 +152,6 @@ public class AccountManager {
dialog.show(((FragmentActivity) activity).getSupportFragmentManager(), null);
}
public void addAccountFromQr(Activity activity, String qr) {
beginAccountCreation(activity);
activity.finishAffinity();
Intent intent = new Intent(activity, InstantOnboardingActivity.class);
intent.putExtra(InstantOnboardingActivity.QR_ACCOUNT_EXTRA, qr);
activity.startActivity(intent);
}
public void addAccountFromSecondDevice(Activity activity, String backupQr) {
switchAccountAndStartActivity(activity, 0, backupQr);
}
@@ -31,7 +31,6 @@ import org.thoughtcrime.securesms.relay.RelayListActivity;
import org.thoughtcrime.securesms.connect.DcEventCenter;
import org.thoughtcrime.securesms.proxy.ProxySettingsActivity;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.ScreenLockUtil;
import org.thoughtcrime.securesms.util.StreamUtil;
import org.thoughtcrime.securesms.util.Util;
@@ -192,10 +191,7 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
Preference relayListBtn = this.findPreference("pref_relay_list_button");
if (relayListBtn != null) {
relayListBtn.setOnPreferenceClickListener(((preference) -> {
boolean result = ScreenLockUtil.applyScreenLock(requireActivity(), getString(R.string.transports), getString(R.string.enter_system_secret_to_continue), REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT);
if (!result) {
openRelayListActivity();
}
openRelayListActivity();
return true;
}));
}
@@ -110,7 +110,7 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
.onAllGranted(() -> ((QrScanFragment) adapter.getItem(TAB_SCAN)).handleQrScanWithPermissions(QrActivity.this))
.onAnyDenied(() -> {
if (scanRelay) {
finish();
Toast.makeText(this, getString(R.string.chat_camera_unavailable), Toast.LENGTH_LONG).show();
} else {
viewPager.setCurrentItem(TAB_SHOW);
}
@@ -123,7 +123,7 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
public boolean onPrepareOptionsMenu(Menu menu) {
menu.clear();
getMenuInflater().inflate(R.menu.qr_show, menu);
menu.findItem(R.id.new_classic_contact).setVisible(!DcHelper.getContext(this).isChatmail());
menu.findItem(R.id.new_classic_contact).setVisible(!scanRelay && !DcHelper.getContext(this).isChatmail());
Util.redMenuItem(menu, R.id.withdraw);
if(tabLayout.getSelectedTabPosition() == TAB_SCAN) {
@@ -162,7 +162,7 @@ public class QrActivity extends BaseActionBarActivity implements View.OnClickLis
&& Manifest.permission.CAMERA.equals(permissions[0])
&& grantResults[0] == PackageManager.PERMISSION_DENIED) {
if (scanRelay) {
finish();
Toast.makeText(this, getString(R.string.chat_camera_unavailable), Toast.LENGTH_LONG).show();
} else {
viewPager.setCurrentItem(TAB_SHOW);
}
@@ -17,6 +17,7 @@ import org.thoughtcrime.securesms.ConversationActivity;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.connect.AccountManager;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.relay.RelayListActivity;
import org.thoughtcrime.securesms.util.IntentUtils;
import org.thoughtcrime.securesms.util.Util;
import org.thoughtcrime.securesms.util.views.ProgressDialog;
@@ -282,7 +283,16 @@ public class QrCodeHandler {
Util.runOnMain(() -> {
if (!progressDialog.isShowing()) return; // canceled dialog, nothing to do
if (finalError != null) {
Toast.makeText(activity, finalError, Toast.LENGTH_LONG).show();
new AlertDialog.Builder(activity)
.setTitle(R.string.error)
.setMessage(finalError)
.setPositiveButton(R.string.ok, null)
.show();
} else {
showDoneToast(activity);
if (!(activity instanceof RelayListActivity)) {
activity.startActivity(new Intent(activity, RelayListActivity.class));
}
}
try {
progressDialog.dismiss();
@@ -37,6 +37,7 @@ public class RelayListActivity extends BaseActionBarActivity
implements RelayListAdapter.OnRelayClickListener, DcEventCenter.DcEventDelegate {
private static final String TAG = RelayListActivity.class.getSimpleName();
public static final String EXTRA_QR_DATA = "qr_data";
private RelayListAdapter adapter;
private Rpc rpc;
@@ -83,6 +84,12 @@ public class RelayListActivity extends BaseActionBarActivity
DcEventCenter eventCenter = DcHelper.getEventCenter(this);
eventCenter.addObserver(DcContext.DC_EVENT_CONFIGURE_PROGRESS, this);
String qrdata = getIntent().getStringExtra(EXTRA_QR_DATA);
if (qrdata != null) {
QrCodeHandler qrCodeHandler = new QrCodeHandler(this);
qrCodeHandler.handleQrData(qrdata);
}
}
@Override
@@ -299,6 +299,11 @@ public class ViewUtil {
return selection;
}
/** Return true if the system supports edge-to-edge properly */
public static boolean isEdgeToEdgeSupported() {
return Build.VERSION.SDK_INT >= VERSION_CODES.R;
}
/**
* Get combined insets from status bar, navigation bar and display cutout areas.
*
@@ -335,7 +340,7 @@ public class ViewUtil {
*/
public static void applyWindowInsetsAsMargin(@NonNull View view, boolean left, boolean top, boolean right, boolean bottom) {
// Only enable on API 30+ where WindowInsets APIs work correctly
if (Build.VERSION.SDK_INT < VERSION_CODES.R) return;
if (!isEdgeToEdgeSupported()) return;
// Store the original margin as a tag only if not already stored
// This prevents losing the true original margin on subsequent calls
@@ -406,7 +411,7 @@ public class ViewUtil {
*/
public static void applyWindowInsets(@NonNull View view, boolean left, boolean top, boolean right, boolean bottom) {
// Only enable on API 30+ where WindowInsets APIs work correctly
if (Build.VERSION.SDK_INT < VERSION_CODES.R) return;
if (!isEdgeToEdgeSupported()) return;
// Store the original padding as a tag only if not already stored
// This prevents losing the true original padding on subsequent calls
@@ -475,7 +480,7 @@ public class ViewUtil {
*/
public static void adjustToolbarForE2E(@NonNull AppCompatActivity activity) {
// Only enable on API 30+ where WindowInsets APIs work correctly
if (Build.VERSION.SDK_INT < VERSION_CODES.R) return;
if (!isEdgeToEdgeSupported()) return;
// The toolbar/app bar should extend behind the status bar with padding applied
View toolbar = activity.findViewById(R.id.toolbar);
@@ -18,11 +18,11 @@ import org.thoughtcrime.securesms.connect.DcHelper;
public class WebxdcGarbageCollectionWorker extends ListenableWorker {
private static final String TAG = WebxdcGarbageCollectionWorker.class.getSimpleName();
private Rpc rpc;
private Context context;
public WebxdcGarbageCollectionWorker(Context context, WorkerParameters params) {
super(context, params);
rpc = DcHelper.getRpc(context);
this.context = context;
}
@Override
@@ -42,6 +42,13 @@ public class WebxdcGarbageCollectionWorker extends ListenableWorker {
return;
}
Rpc rpc = DcHelper.getRpc(context);
if (rpc == null) {
Log.e(TAG, "Failed to get access to RPC, Webxdc storage garbage collection aborted.");
completer.set(Result.failure());
return;
}
for (Object key : origins.keySet()) {
String url = (String)key;
Matcher m = WEBXDC_URL_PATTERN.matcher(url);