github.com/status-im/status-go@v1.1.0/protocol/protobuf/chat_message.proto (about)

     1  syntax = "proto3";
     2  
     3  option go_package = "./;protobuf";
     4  package protobuf;
     5  
     6  import "enums.proto";
     7  import "contact.proto";
     8  import "shard.proto";
     9  
    10  message StickerMessage {
    11    string hash = 1;
    12    int32 pack = 2;
    13  }
    14  
    15  message ImageMessage {
    16    bytes payload = 1;
    17    ImageFormat format = 2;
    18    string album_id = 3;
    19    uint32 width = 4;
    20    uint32 height = 5;
    21    uint32 album_images_count = 6;
    22  }
    23  
    24  message AudioMessage {
    25    bytes payload = 1;
    26    AudioType type = 2;
    27    uint64 duration_ms = 3;
    28    enum AudioType {
    29      UNKNOWN_AUDIO_TYPE = 0;
    30      AAC = 1;
    31      AMR = 2;
    32    }
    33  }
    34  
    35  message EditMessage {
    36    uint64 clock = 1;
    37    // Text of the message
    38    string text = 2;
    39  
    40    string chat_id = 3;
    41    string message_id = 4;
    42  
    43    // Grant for community edit messages
    44    bytes grant = 5 [deprecated = true];
    45  
    46    // The type of message (public/one-to-one/private-group-chat)
    47    MessageType message_type = 6;
    48  
    49    ChatMessage.ContentType content_type = 7;
    50    repeated UnfurledLink unfurled_links = 8;
    51    UnfurledStatusLinks unfurled_status_links = 9;
    52  }
    53  
    54  message DeleteMessage {
    55    uint64 clock = 1;
    56  
    57    string chat_id = 2;
    58    string message_id = 3;
    59  
    60    // Grant for community delete messages
    61    bytes grant = 4 [deprecated = true];
    62  
    63    // The type of message (public/one-to-one/private-group-chat)
    64    MessageType message_type = 5;
    65  
    66    string deleted_by = 6;
    67  }
    68  
    69  message SyncDeleteForMeMessage {
    70    uint64 clock = 1;
    71    string message_id = 2;
    72  }
    73  
    74  message DiscordMessage {
    75    string id = 1;
    76    string type = 2;
    77    string timestamp = 3;
    78    string timestampEdited = 4;
    79    string content = 5;
    80    DiscordMessageAuthor author = 6;
    81    DiscordMessageReference reference = 7;
    82    repeated DiscordMessageAttachment attachments = 8;
    83  }
    84  
    85  message DiscordMessageAuthor {
    86    string id = 1;
    87    string name = 2;
    88    string discriminator = 3;
    89    string nickname = 4;
    90    string avatarUrl = 5;
    91    bytes avatarImagePayload = 6;
    92    string localUrl = 7;
    93  }
    94  
    95  message DiscordMessageReference {
    96    string messageId = 1;
    97    string channelId = 2;
    98    string guildId = 3;
    99  }
   100  
   101  message DiscordMessageAttachment {
   102    string id = 1;
   103    string messageId = 2;
   104    string url = 3;
   105    string fileName = 4;
   106    uint64 fileSizeBytes = 5;
   107    string contentType = 6;
   108    bytes payload = 7;
   109    string localUrl = 8;
   110  }
   111  
   112  message BridgeMessage {
   113    string bridgeName = 1;
   114    string userName = 2;
   115    string userAvatar = 3;
   116    string userID = 4;
   117    string content = 5;
   118    string messageID = 6;
   119    string parentMessageID = 7;
   120  }
   121  
   122  message UnfurledLinkThumbnail {
   123    bytes payload = 1;
   124    uint32 width = 2;
   125    uint32 height = 3;
   126  }
   127  
   128  message UnfurledLink {
   129    // A valid URL which uniquely identifies this link.
   130    string url = 1;
   131    // Website's title.
   132    string title = 2;
   133    // Description is sometimes available, but can be empty. Most mainstream
   134    // websites provide this information.
   135    string description = 3;
   136    bytes thumbnail_payload = 4;
   137    uint32 thumbnail_width = 5;
   138    uint32 thumbnail_height = 6;
   139    LinkType type = 7;
   140    bytes favicon_payload = 8;
   141  
   142    enum LinkType {
   143      LINK = 0;
   144      IMAGE = 1;
   145    }
   146  }
   147  
   148  message UnfurledStatusContactLink {
   149    bytes public_key = 1;
   150    string display_name = 2;
   151    string description = 3;
   152    UnfurledLinkThumbnail icon = 4;
   153  }
   154  
   155  message UnfurledStatusCommunityLink {
   156    bytes community_id = 1;
   157    string display_name = 2;
   158    string description = 3;
   159    uint32 members_count = 4;
   160    string color = 5;
   161    UnfurledLinkThumbnail icon = 7;
   162    UnfurledLinkThumbnail banner = 8;
   163  }
   164  
   165  message UnfurledStatusChannelLink {
   166    string channel_uuid = 1;
   167    string emoji = 2;
   168    string display_name = 3;
   169    string description = 4;
   170    string color = 5;
   171    UnfurledStatusCommunityLink community = 6;
   172  }
   173  
   174  message UnfurledStatusLink {
   175    string url = 1;
   176    oneof payload {
   177      UnfurledStatusContactLink contact = 2;
   178      UnfurledStatusCommunityLink community = 3;
   179      UnfurledStatusChannelLink channel = 4;
   180    }
   181  }
   182  
   183  // Create a wrapper around repeated property for proper unmarshalling
   184  message UnfurledStatusLinks {
   185    repeated UnfurledStatusLink unfurled_status_links = 1;
   186  }
   187  
   188  message ChatMessage {
   189    // Lamport timestamp of the chat message
   190    uint64 clock = 1;
   191    // Unix timestamps in milliseconds, currently not used as we use whisper as
   192    // more reliable, but here so that we don't rely on it
   193    uint64 timestamp = 2;
   194    // Text of the message
   195    string text = 3;
   196    // Id of the message that we are replying to
   197    string response_to = 4;
   198    // Ens name of the sender
   199    string ens_name = 5;
   200    // Chat id, this field is symmetric for public-chats and private group chats,
   201    // but asymmetric in case of one-to-ones, as the sender will use the chat-id
   202    // of the received, while the receiver will use the chat-id of the sender.
   203    // Probably should be the concatenation of sender-pk & receiver-pk in
   204    // alphabetical order
   205    string chat_id = 6;
   206  
   207    // The type of message (public/one-to-one/private-group-chat)
   208    MessageType message_type = 7;
   209    // The type of the content of the message
   210    ContentType content_type = 8;
   211  
   212    oneof payload {
   213      StickerMessage sticker = 9;
   214      ImageMessage image = 10;
   215      AudioMessage audio = 11;
   216      bytes community = 12;
   217      DiscordMessage discord_message = 99;
   218      BridgeMessage bridge_message = 100;
   219    }
   220  
   221    // Grant for community chat messages
   222    bytes grant = 13 [deprecated = true];
   223  
   224    // Message author's display name, introduced in version 1
   225    string display_name = 14;
   226  
   227    ContactRequestPropagatedState contact_request_propagated_state = 15;
   228  
   229    repeated UnfurledLink unfurled_links = 16;
   230  
   231    Shard shard = 17;
   232  
   233    UnfurledStatusLinks unfurled_status_links = 18;
   234  
   235    uint32 customization_color = 19;
   236  
   237    enum ContentType {
   238      UNKNOWN_CONTENT_TYPE = 0;
   239      TEXT_PLAIN = 1;
   240      STICKER = 2;
   241      STATUS = 3;
   242      EMOJI = 4;
   243      TRANSACTION_COMMAND = 5;
   244      // Only local
   245      SYSTEM_MESSAGE_CONTENT_PRIVATE_GROUP = 6;
   246      IMAGE = 7;
   247      AUDIO = 8;
   248      COMMUNITY = 9;
   249      // Only local
   250      SYSTEM_MESSAGE_GAP = 10;
   251      CONTACT_REQUEST = 11;
   252      DISCORD_MESSAGE = 12;
   253      IDENTITY_VERIFICATION = 13;
   254      // Only local
   255      SYSTEM_MESSAGE_PINNED_MESSAGE = 14;
   256      // Only local
   257      SYSTEM_MESSAGE_MUTUAL_EVENT_SENT = 15;
   258      // Only local
   259      SYSTEM_MESSAGE_MUTUAL_EVENT_ACCEPTED = 16;
   260      // Only local
   261      SYSTEM_MESSAGE_MUTUAL_EVENT_REMOVED = 17;
   262      BRIDGE_MESSAGE = 18;
   263    }
   264  }