md-d2d-sync.proto 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
  1. // ## Data Synchronisation Messages
  2. //
  3. // All strings are UTF-8 encoded.
  4. //
  5. // ### General Information
  6. //
  7. // When creating a sync message, only provide fields which are required and
  8. // fields whose values have changed (i.e. delta updates). Fields that are
  9. // required will be explicitly marked. For any other field within a sync
  10. // message, assume that it is optional.
  11. //
  12. // When receiving a sync message, only handle fields whose values have been
  13. // provided. As a rule of thumb, if a field is not present it means that the
  14. // value has not changed.
  15. //
  16. // If more specific rules are needed in order to handle a field correctly,
  17. // a description will be provided for the specific field.
  18. //
  19. // ### Validation
  20. //
  21. // A sync message should be validated by the following general rules:
  22. //
  23. // - Strictly validate enums, i.e. unknown values are not allowed and no
  24. // silent fallbacks are allowed.
  25. // - Empty strings/lists have a different semantic than an omitted string/list.
  26. // The field should have a concise description on whether emptiness is
  27. // allowed, and, if so, the meaning of _empty_.
  28. // - Follow the description of each field for more specific validation.
  29. //
  30. // If any of these rules is violated, the message should be discarded and logged
  31. // as an error (but still acknowledged, if necessary).
  32. syntax = "proto3";
  33. package sync;
  34. option java_package = "ch.threema.protobuf.d2d.sync";
  35. import "common.proto";
  36. // _Read_ receipt policy (when an unread message has been read)
  37. enum ReadReceiptPolicy {
  38. // Send _read_ receipt when an unread message has been read
  39. SEND_READ_RECEIPT = 0;
  40. // Don't send _read_ receipts
  41. DONT_SEND_READ_RECEIPT = 1;
  42. }
  43. // Typing indicator policy (signal _currently typing_)
  44. enum TypingIndicatorPolicy {
  45. // Send _typing_ indicator when a message is being composed
  46. SEND_TYPING_INDICATOR = 0;
  47. // Don't send _typing_ indicators
  48. DONT_SEND_TYPING_INDICATOR = 1;
  49. }
  50. // Notification sound policy.
  51. enum NotificationSoundPolicy {
  52. // Do not emit a sound when notifying of a _conversation_ message.
  53. MUTED = 0;
  54. }
  55. // Visibility of a conversation.
  56. enum ConversationVisibility {
  57. // Appears normally in the list of conversations
  58. NORMAL = 0;
  59. // Appears pinned in the list of conversations
  60. PINNED = 2;
  61. // Appears in the archived list of conversations
  62. ARCHIVED = 1;
  63. }
  64. // Category of a conversation.
  65. enum ConversationCategory {
  66. // No specific (default) category
  67. DEFAULT = 0;
  68. // Protected conversation (_private chat_)
  69. PROTECTED = 1;
  70. }
  71. // Application configuration parameters shared across Threema Work devices.
  72. //
  73. // See [mdm-parameters.md](./md-parameters.md) for documentation of possible
  74. // parameter values and associated steps to apply when a parameter has been set
  75. // for the first time, modified, or removed.
  76. //
  77. // Note: MDM parameters are always transmitted fully, not as delta updates.
  78. message MdmParameters {
  79. // A single MDM parameter.
  80. message Parameter {
  81. oneof value {
  82. // String parameter
  83. string string_value = 1;
  84. // Integer parameter
  85. uint64 integer_value = 3;
  86. // Boolean parameter
  87. bool boolean_value = 2;
  88. }
  89. }
  90. // A map of MDM parameters, originating from an external MDM system. The map
  91. // key is the identifier of the MDM parameter (e.g. `th_nickname`).
  92. map<string, Parameter> external_parameters = 1;
  93. // A map of MDM parameters, originating from Threema App Configuration. The
  94. // map key is the identifier of the MDM parameter (e.g. `th_nickname`).
  95. map<string, Parameter> threema_parameters = 2;
  96. enum ParameterPrecedence {
  97. // On conflict, parameters defined by Threema App Configuration take
  98. // precedence
  99. THREEMA = 0;
  100. // On conflict, parameters defined by an external MDM take precedence
  101. EXTERNAL = 1;
  102. }
  103. // The parameter precedence defines how to resolve conflicting parameters
  104. // between an external MDM and the Threema App Configuration.
  105. ParameterPrecedence parameter_precedence = 3;
  106. }
  107. // Threema Work credentials for authentication towards Work APIs.
  108. message ThreemaWorkCredentials {
  109. // Work username.
  110. string username = 1;
  111. // Work password.
  112. string password = 2;
  113. }
  114. // The user's profile.
  115. message UserProfile {
  116. // Nickname
  117. //
  118. // Required towards a new device. Optional otherwise.
  119. //
  120. // When the user cleared its nickname, send an empty string. Do not send the
  121. // user's Threema ID (i.e. process data).
  122. //
  123. // When an empty string was received, store the empty string as-is and fall
  124. // back to the users Threema ID when sending an end-to-end encrypted message.
  125. optional string nickname = 1;
  126. // Profile picture
  127. //
  128. // Always optional.
  129. common.DeltaImage profile_picture = 2;
  130. // Profile picture share policy
  131. //
  132. // Required towards a new device. Optional otherwise.
  133. message ProfilePictureShareWith {
  134. oneof policy {
  135. // Don't share
  136. common.Unit nobody = 1;
  137. // Share with everyone
  138. common.Unit everyone = 2;
  139. // Share only with explicitly listed contacts
  140. //
  141. // When the user selected _allow list_ but did not select any contacts,
  142. // send an empty list. Do not fall back to `nobody`.
  143. common.Identities allow_list = 3;
  144. }
  145. }
  146. ProfilePictureShareWith profile_picture_share_with = 3;
  147. // External entities linked with the identity
  148. //
  149. // Required towards a new device. Optional otherwise.
  150. //
  151. // When the user has cleared all of its identity links, this message is
  152. // present but `links` contains zero items.
  153. message IdentityLinks {
  154. // Threema ID link.
  155. message IdentityLink {
  156. // Identity link type
  157. oneof type {
  158. // Linked with a verified telephone number (E.164 format without leading
  159. // `+`)
  160. string phone_number = 1;
  161. // Linked with a verified email address
  162. string email = 2;
  163. }
  164. // Identity link description
  165. string description = 3;
  166. }
  167. // List of identity links
  168. repeated IdentityLink links = 1;
  169. }
  170. IdentityLinks identity_links = 4;
  171. }
  172. // Threema contact.
  173. message Contact {
  174. // Threema ID of the contact
  175. //
  176. // Always required.
  177. string identity = 1;
  178. // Public key of the contact
  179. //
  180. // Required towards a new device and for a new contact. Should not be set
  181. // for existing contacts and must be ignored (a public key for an identity
  182. // cannot be changed).
  183. optional bytes public_key = 2;
  184. // Unix-ish timestamp in milliseconds when the contact has been created
  185. // (added) locally.
  186. //
  187. // Required towards a new device and for a new contact. Optional for an
  188. // existing contact.
  189. optional uint64 created_at = 3;
  190. // First name of the contact
  191. //
  192. // Always optional.
  193. //
  194. // An empty string is valid. When both `first_name` and `last_name` are
  195. // empty string, the `nickname` should be used as display name.
  196. optional string first_name = 4;
  197. // Last name of the contact
  198. //
  199. // Always optional.
  200. //
  201. // An empty string is valid. When both `first_name` and `last_name` are
  202. // empty string, the `nickname` should be used as display name.
  203. optional string last_name = 5;
  204. // Nickname of the contact (without `~` prefix)
  205. //
  206. // Always optional.
  207. //
  208. // An empty string is valid. If `first_name`, `last_name` and `nickname` are
  209. // empty string, the Threema ID should be used as display name.
  210. optional string nickname = 6;
  211. // Verification level of the contact
  212. //
  213. // Required towards a new device and for a new contact. Optional for an
  214. // existing contact.
  215. //
  216. // Note: When applying logic depending on the verification level, a
  217. // `WorkVerificationLevel` of `WORK_SUBSCRIPTION_VERIFIED` virtually raises
  218. // the verification level to `SERVER_VERIFIED`. However, the contact
  219. // verification level takes precedence if it is `FULLY_VERIFIED`.
  220. enum VerificationLevel {
  221. // Unverified, public key has been obtained from the server
  222. UNVERIFIED = 0;
  223. // Verified with one of the account links via the server, or the contact
  224. // has been obtained via the Work API.
  225. SERVER_VERIFIED = 1;
  226. // Verified, public key has been obtained via a secure channel
  227. FULLY_VERIFIED = 2;
  228. }
  229. optional VerificationLevel verification_level = 7;
  230. // Threema Work verification level of the contact.
  231. //
  232. // Required towards a new device and for a new contact. Optional for an
  233. // existing contact.
  234. //
  235. // Note: When not using a Threema Work client, the Threema Work verification
  236. // level must always be `NONE`.
  237. enum WorkVerificationLevel {
  238. // The user does not use Threema Work or the contact is not in the same
  239. // Threema Work subscription.
  240. NONE = 0;
  241. // The contact is in the same Threema Work subscription.
  242. WORK_SUBSCRIPTION_VERIFIED = 1;
  243. }
  244. optional WorkVerificationLevel work_verification_level = 21;
  245. // Identity type of the contact
  246. //
  247. // Required towards a new device and for a new contact. Optional for an
  248. // existing contact.
  249. enum IdentityType {
  250. // Regular contact (uses the regular Threema app)
  251. REGULAR = 0;
  252. // Work contact (uses the Threema work app)
  253. WORK = 1;
  254. }
  255. optional IdentityType identity_type = 8;
  256. // Acquaintance level of the contact
  257. //
  258. // Required towards a new device and for a new contact. Optional for an
  259. // existing contact.
  260. enum AcquaintanceLevel {
  261. // The contact was explicitly added by the user or a 1:1 conversation with
  262. // the contact has been initiated.
  263. DIRECT = 0;
  264. // This level covers the following cases:
  265. //
  266. // - The contact is part of a group the user is also part of. The contact
  267. // was not explicitly added and no 1:1 conversation has been initiated.
  268. // - The contact was part of a group the user was/is also part of before but
  269. // either of them has since been removed from all common groups.
  270. // - The contact has been explicitly removed by the user.
  271. //
  272. // The protocol refers to contacts with this level as either acquaintance
  273. // level _group_ or _deleted_. They are interchangeable and there's no
  274. // semantic difference between them beyond the context in which they are
  275. // referred to.
  276. GROUP_OR_DELETED = 1;
  277. }
  278. optional AcquaintanceLevel acquaintance_level = 9;
  279. // Activity state of the contact
  280. //
  281. // Required towards a new device and for a new contact. Optional for an
  282. // existing contact.
  283. enum ActivityState {
  284. // The ID is active (used recently and not deleted).
  285. ACTIVE = 0;
  286. // The ID has not been used for a prolonged time (typically 3 months) and
  287. // may have been abandoned. Such IDs can be marked as "inactive" in the
  288. // client's contact database, and the user may be alerted to the fact that
  289. // messages to this ID may not arrive (e.g. alert box, gray color in
  290. // contact list etc.). An inactive ID can become active again at any time,
  291. // so the client should keep checking it.
  292. INACTIVE = 1;
  293. // ID has never been assigned, or it has been permanently deleted. Such IDs
  294. // should be marked as "deleted" in the client's contact database, and no
  295. // further messages should be sent or received from them. Since deletion is
  296. // permanent, once an ID has been reported as invalid by the server, it
  297. // should not be checked again in the future.
  298. INVALID = 2;
  299. }
  300. optional ActivityState activity_state = 10;
  301. // Features available for the contact (64 bit mask,
  302. // `common.CspFeatureMaskFlag` logically or-ed).
  303. //
  304. // Required towards a new device and for a new contact. Optional for an
  305. // existing contact.
  306. optional uint64 feature_mask = 18;
  307. // Contact synchronisation state
  308. //
  309. // Required towards a new device and for a new contact. Optional for an
  310. // existing contact.
  311. //
  312. // These states are strict monotonic. When a downgrade is being detected,
  313. // log the incident and ignore the update.
  314. enum SyncState {
  315. // The contact data has not been imported and has not been edited by the
  316. // user either.
  317. INITIAL = 0;
  318. // The contact data has been imported (e.g. via a local address book and an
  319. // identity link). In this state, subsequent contact synchronisations must
  320. // not alter the contact's data.
  321. IMPORTED = 1;
  322. // The contact data has been edited by the user. In this state, subsequent
  323. // contact synchronisations must not alter the contact's data.
  324. CUSTOM = 2;
  325. }
  326. optional SyncState sync_state = 13;
  327. // _Read_ receipt policy override for this contact
  328. //
  329. // Required towards a new device and for a new contact. Optional for an
  330. // existing contact.
  331. message ReadReceiptPolicyOverride {
  332. oneof override {
  333. // Apply the _read_ receipt policy specified in the settings
  334. common.Unit default = 1;
  335. // Apply the following _read_ receipt policy
  336. ReadReceiptPolicy policy = 2;
  337. }
  338. }
  339. ReadReceiptPolicyOverride read_receipt_policy_override = 16;
  340. // Typing indicator policy override for this contact
  341. //
  342. // Required towards a new device and for a new contact. Optional for an
  343. // existing contact.
  344. message TypingIndicatorPolicyOverride {
  345. oneof override {
  346. // Apply the typing indicator policy specified in the settings
  347. common.Unit default = 1;
  348. // Apply the following typing indicator policy
  349. TypingIndicatorPolicy policy = 2;
  350. }
  351. }
  352. TypingIndicatorPolicyOverride typing_indicator_policy_override = 17;
  353. // Notification trigger policy for the contact
  354. //
  355. // Required towards a new device and for a new contact. Optional for an
  356. // existing contact.
  357. message NotificationTriggerPolicyOverride {
  358. message Policy {
  359. // Apply the following notification trigger policy
  360. enum NotificationTriggerPolicy {
  361. // Never trigger a notification message.
  362. NEVER = 0;
  363. }
  364. NotificationTriggerPolicy policy = 1;
  365. // Unix-ish timestamp in milliseconds when the provided policy should
  366. // expire and fall back to the default. If not provided, the policy does
  367. // not expire.
  368. optional uint64 expires_at = 2;
  369. }
  370. oneof override {
  371. // Apply the trigger policy specified in the settings (i.e. trigger on
  372. // every _conversation_ message).
  373. common.Unit default = 1;
  374. // Apply the following notification trigger policy
  375. Policy policy = 2;
  376. }
  377. }
  378. NotificationTriggerPolicyOverride notification_trigger_policy_override = 19;
  379. // Notification sound policy for the contact
  380. //
  381. // Required towards a new device and for a new contact. Optional for an
  382. // existing contact.
  383. //
  384. // Custom sounds are not reflected but are to be (re-)applied in case the
  385. // policy is _default_.
  386. message NotificationSoundPolicyOverride {
  387. oneof override {
  388. // Apply the notification sound policy specified in the settings (i.e.
  389. // always emit a sound when notifying of a _conversation_ message).
  390. common.Unit default = 1;
  391. // Apply the following notification sound policy
  392. NotificationSoundPolicy policy = 2;
  393. }
  394. }
  395. NotificationSoundPolicyOverride notification_sound_policy_override = 20;
  396. // Contact-defined profile picture as received from the contact in a
  397. // `set-profile-picture` message.
  398. //
  399. // Always optional.
  400. common.DeltaImage contact_defined_profile_picture = 14;
  401. // User-defined profile picture set by the user or imported from the address
  402. // book.
  403. //
  404. // Always optional.
  405. common.DeltaImage user_defined_profile_picture = 15;
  406. // Conversation category of the contact
  407. //
  408. // Required towards a new device and for a new contact. Optional for an
  409. // existing contact.
  410. optional ConversationCategory conversation_category = 11;
  411. // Conversation visibility of the contact
  412. //
  413. // Required towards a new device and for a new contact. Optional for an
  414. // existing contact.
  415. optional ConversationVisibility conversation_visibility = 12;
  416. }
  417. // Threema contacts associated to a group.
  418. message Group {
  419. // Unique group identity
  420. //
  421. // Always required.
  422. common.GroupIdentity group_identity = 1;
  423. // Name of the group
  424. //
  425. // Required towards a new device and for a new group. Optional for an
  426. // existing group.
  427. //
  428. // An empty string is valid. In such a case, the display name of the
  429. // group is the list of its members.
  430. optional string name = 2;
  431. // Unix-ish timestamp in milliseconds when the group has been created locally
  432. //
  433. // Required towards a new device and for a new group. Optional for an
  434. // existing group.
  435. optional uint64 created_at = 3;
  436. // The user's state within the group
  437. //
  438. // Required towards a new device and for a new group. Optional for an
  439. // existing group.
  440. enum UserState {
  441. // The user is a member (or creator) of the group.
  442. MEMBER = 0;
  443. // The user has been kicked from the group. Implies that the group has been
  444. // marked as _left_.
  445. KICKED = 1;
  446. // The user left the group. Implies that the group has been marked as
  447. // _left_. If the user is the creator, this implies that the group has been
  448. // disbanded.
  449. LEFT = 2;
  450. }
  451. optional UserState user_state = 6;
  452. // Group's profile picture as received from the group's creator
  453. //
  454. // Always optional.
  455. common.DeltaImage profile_picture = 7;
  456. // Group members (**NOT** including the creator and the user itself)
  457. //
  458. // Required towards a new device and for a new group. Optional for an existing
  459. // group.
  460. //
  461. // The concrete semantic of this list depends on the current `user_state`:
  462. //
  463. // - `MEMBER`: It contains a list of all **current** group members (with the
  464. // user itself implicitly added).
  465. // - `KICKED`/`LEFT`: It contains a list of all **previous** group members up
  466. // to that event. If the list is empty, the group must not be visible in the
  467. // UI.
  468. //
  469. // An empty list is valid.
  470. common.Identities member_identities = 8;
  471. // Notification trigger policy for the group
  472. //
  473. // Required towards a new device and for a new group. Optional for an
  474. // existing group.
  475. message NotificationTriggerPolicyOverride {
  476. message Policy {
  477. // Apply the following notification trigger policy
  478. enum NotificationTriggerPolicy {
  479. // Only trigger a notification if mentioned in a _conversation_ message.
  480. MENTIONED = 0;
  481. // Never trigger a notification message.
  482. NEVER = 1;
  483. }
  484. NotificationTriggerPolicy policy = 1;
  485. // Unix-ish timestamp in milliseconds when the provided policy should
  486. // expire and fall back to the default. If not provided, the policy does
  487. // not expire.
  488. optional uint64 expires_at = 2;
  489. }
  490. oneof override {
  491. // Apply the trigger policy specified in the settings (i.e. trigger on
  492. // every _conversation_ message).
  493. common.Unit default = 1;
  494. // Apply the following notification trigger policy
  495. Policy policy = 2;
  496. }
  497. }
  498. NotificationTriggerPolicyOverride notification_trigger_policy_override = 9;
  499. // Notification sound policy for the group
  500. //
  501. // Required towards a new device and for a new group. Optional for an existing
  502. // group.
  503. //
  504. // Custom sounds are not reflected but are to be (re-)applied in case the
  505. // policy is _default_.
  506. message NotificationSoundPolicyOverride {
  507. oneof override {
  508. // Apply the notification sound policy specified in the settings (i.e.
  509. // always emit a sound when notifying of a _conversation_ message).
  510. common.Unit default = 1;
  511. // Apply the following notification sound policy
  512. NotificationSoundPolicy policy = 2;
  513. }
  514. }
  515. NotificationSoundPolicyOverride notification_sound_policy_override = 10;
  516. // Conversation category of the group
  517. //
  518. // Required towards a new device and for a new group. Optional for an
  519. // existing group.
  520. optional ConversationCategory conversation_category = 4;
  521. // Conversation visibility of the group
  522. //
  523. // Required towards a new device and for a new group. Optional for an
  524. // existing group.
  525. optional ConversationVisibility conversation_visibility = 5;
  526. }
  527. // Threema contacts associated to a distribution list.
  528. message DistributionList {
  529. // Unique ID of the distribution list
  530. //
  531. // Always required.
  532. fixed64 distribution_list_id = 1;
  533. // Name of the distribution list
  534. //
  535. // Required towards a new device and for a new distribution list. Optional
  536. // for an existing distribution list.
  537. //
  538. // An empty string is valid. In such a case, the display name of the
  539. // distribution list is the list of its members.
  540. optional string name = 2;
  541. // Unix-ish timestamp in milliseconds when the group has been created
  542. //
  543. // Required towards a new device and for a new distribution list. Optional
  544. // for an existing distribution list.
  545. optional uint64 created_at = 3;
  546. // Distribution list members
  547. //
  548. // Required towards a new device and for a new distribution list. Optional
  549. // for an existing distribution list.
  550. //
  551. // An empty list is **not** valid. Clearing all members should be prevented
  552. // by the UI.
  553. common.Identities member_identities = 6;
  554. // Conversation category of the distribution list
  555. //
  556. // Required towards a new device and for a new distribution list. Optional
  557. // for an existing distribution list.
  558. optional ConversationCategory conversation_category = 4;
  559. // Conversation visibility of the distribution list
  560. //
  561. // Required towards a new device and for a new distribution list. Optional
  562. // for an existing distribution list.
  563. optional ConversationVisibility conversation_visibility = 5;
  564. }
  565. // App settings
  566. //
  567. // When the user changes one or more settings:
  568. //
  569. // 1. Begin a transaction (scope: `SETTINGS_SYNC`, precondition: none).
  570. // 2. For each setting that has been modified, run the associated steps of the
  571. // setting and include the modified settings.
  572. // 3. Reflect this message and commit the transaction.
  573. // 4. Apply the modified settings locally.
  574. //
  575. // When reflected from another device:
  576. //
  577. // 1. For each setting that is being included by this message, run the
  578. // associated steps of the setting and apply the modified setting.
  579. message Settings {
  580. // Contact synchronisation policy
  581. //
  582. // Required towards a new device. Optional otherwise.
  583. enum ContactSyncPolicy {
  584. // Not synced
  585. NOT_SYNCED = 0;
  586. // Synced
  587. SYNC = 1;
  588. }
  589. optional ContactSyncPolicy contact_sync_policy = 1;
  590. // Unknown contacts policy
  591. //
  592. // Required towards a new device. Optional otherwise.
  593. enum UnknownContactPolicy {
  594. // Allowed to contact the user
  595. ALLOW_UNKNOWN = 0;
  596. // Will be blocked by the user
  597. BLOCK_UNKNOWN = 1;
  598. }
  599. optional UnknownContactPolicy unknown_contact_policy = 2;
  600. // _Read_ receipt policy (when an unread message has been read)
  601. //
  602. // Required towards a new device. Optional otherwise.
  603. optional ReadReceiptPolicy read_receipt_policy = 3;
  604. // Typing indicator policy (signal _currently typing_)
  605. //
  606. // Required towards a new device. Optional otherwise.
  607. optional TypingIndicatorPolicy typing_indicator_policy = 4;
  608. // Threema 1:1 Call policy
  609. //
  610. // Required towards a new device. Optional otherwise.
  611. enum O2oCallPolicy {
  612. // Allow creating/receiving Threema 1:1 Calls
  613. ALLOW_O2O_CALL = 0;
  614. // Denied from creating/receiving any Threema 1:1 Calls
  615. DENY_O2O_CALL = 1;
  616. }
  617. optional O2oCallPolicy o2o_call_policy = 5;
  618. // Threema 1:1 Call connection policy.
  619. //
  620. // Required towards a new device. Optional otherwise.
  621. //
  622. // Note: This is only relevant for 1:1 calls.
  623. enum O2oCallConnectionPolicy {
  624. // Allow direct (peer-to-peer) connections for Threema 1:1 Calls
  625. ALLOW_DIRECT_CONNECTION = 0;
  626. // Require relayed connections for Threema 1:1 Calls
  627. REQUIRE_RELAYED_CONNECTION = 1;
  628. }
  629. optional O2oCallConnectionPolicy o2o_call_connection_policy = 6;
  630. // Threema 1:1 Call video (stream) policy.
  631. //
  632. // Required towards a new device. Optional otherwise.
  633. enum O2oCallVideoPolicy {
  634. // Allow sending and receiving video streams in Threema 1:1 Calls.
  635. ALLOW_VIDEO = 0;
  636. // Reject and don't send video streams in Threema 1:1 Calls.
  637. DENY_VIDEO = 1;
  638. }
  639. optional O2oCallVideoPolicy o2o_call_video_policy = 12;
  640. // Threema Group Call policy
  641. //
  642. // Required towards a new device. Optional otherwise.
  643. enum GroupCallPolicy {
  644. // Allow creating/receiving Threema Group Calls
  645. ALLOW_GROUP_CALL = 0;
  646. // Denied from creating/receiving any Threema Group Calls
  647. DENY_GROUP_CALL = 1;
  648. }
  649. optional GroupCallPolicy group_call_policy = 11;
  650. // Screenshot policy
  651. //
  652. // Required towards a new device. Optional otherwise.
  653. enum ScreenshotPolicy {
  654. // Allow taking screenshots
  655. ALLOW_SCREENSHOT = 0;
  656. // Deny taking screenshots, if possible
  657. DENY_SCREENSHOT = 1;
  658. }
  659. optional ScreenshotPolicy screenshot_policy = 7;
  660. // Keyboard data collection policy (e.g. for personalised suggestions)
  661. //
  662. // Required towards a new device. Optional otherwise.
  663. enum KeyboardDataCollectionPolicy {
  664. // Allow keyboard input data to be collected
  665. ALLOW_DATA_COLLECTION = 0;
  666. // Deny collecting of keyboard input data
  667. DENY_DATA_COLLECTION = 1;
  668. }
  669. optional KeyboardDataCollectionPolicy keyboard_data_collection_policy = 8;
  670. // List of Threema IDs whose messages are blocked
  671. //
  672. // Required towards a new device. Optional otherwise.
  673. //
  674. // An empty list is valid.
  675. common.Identities blocked_identities = 9;
  676. // Threema IDs to be excluded when syncing the contact list
  677. //
  678. // Required towards a new device. Optional otherwise.
  679. //
  680. // An empty list is valid.
  681. common.Identities exclude_from_sync_identities = 10;
  682. }