You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/SPECIFICATION.md
+38-16Lines changed: 38 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,15 +260,18 @@ Casts are added with a `CastAdd` message and removed with a tombstone `CastRemov
260
260
261
261
```protobuf
262
262
message CastAddBody {
263
-
repeated string embeds = 1; // URIs to embed alongside the text
264
-
repeated uint64 mentions = 2; // User fids mentioned in the text
265
-
oneof parent {
266
-
CastId parent_cast_id = 3; // Optional parent of the cast
263
+
repeated string embeds_deprecated = 1; // Deprecated embeds field
264
+
repeated uint64 mentions = 2; // User fids mentioned in the text
265
+
oneof parent { // Optional parent of the cast
266
+
CastId parent_cast_id = 3;
267
+
string parent_url = 7; // Parent URL
267
268
};
268
-
string text = 4; // Text of the cast
269
-
repeated uint32 mentions_positions = 5; // Byte positions of the mentions in the text
269
+
string text = 4; // Text of the cast
270
+
repeated uint32 mentions_positions = 5; // Byte positions of the mentions in the text
271
+
repeated Embed embeds = 6; // URIs or CastIds to embedded in the cast
270
272
}
271
273
274
+
272
275
message CastRemoveBody {
273
276
bytes target_hash = 1; // Message.hash value of the cast being removed
274
277
}
@@ -277,19 +280,27 @@ message CastId {
277
280
uint64 fid = 1; // Fid of the cast's author
278
281
bytes hash = 2; // Message.hash value of the cast
279
282
}
283
+
284
+
message Embed {
285
+
oneof embed {
286
+
string url = 1;
287
+
CastId cast_id = 2;
288
+
}
289
+
}
280
290
```
281
291
282
292
A CastAddBody in a message `m` is valid only if it passes these validations:
283
293
284
294
1.`m.signature_scheme` must be `SIGNATURE_SCHEME_ED25519`.
285
295
2.`m.data.type` must be `MESSAGE_TYPE_CAST_ADD`.
286
296
3.`m.data.body.type` must be `CastAddBody`.
287
-
4.`m.data.body.embeds` can contain up to 2 valid utf8 strings are between 1 and 256 bytes inclusive.
297
+
4.`m.data.body.embeds_deprecated` can contain up to 2 valid UTF8 strings whose lengths are >=1 byte and <= 256 bytes if the timestamp is <= 73612800 (5/3/23 00:00 UTC).
288
298
5.`m.data.body.mentions` must contain between 0 and 10 256-bit integer values.
289
-
6.`m.data.body.parent`, if present, must be a valid CastId
290
-
7.`m.data.body.text` must contain <= 320 bytes and be a valid utf8 string.
299
+
6.`m.data.body.parent`, if present, must be a valid CastId or a UTF8 string whose length is >= 1 byte and <= 256 bytes.
300
+
7.`m.data.body.text` must contain <= 320 bytes and be a valid UTF8 string.
291
301
8.`m.data.body.mentions_positions` must have unique integers between 0 and length of `text` inclusive.
292
302
9.`m.data.body.mentions_positions` integers must be in ascending order and must have as many elements as `mentions`.
303
+
10.`m.data.body.embeds` can contain up to 2 embeds, each of which is a CastId or valid UTF8 string whose length is >=1 byte and <= 256bytes.
293
304
294
305
A CastRemoveBody in a message `m` is valid only if it passes these validations:
295
306
@@ -313,7 +324,8 @@ Reactions are added with a `ReactionAdd` message and removed with a `ReactionRem
313
324
message ReactionBody {
314
325
ReactionType type = 1; // Type of reaction
315
326
oneof target {
316
-
CastId target_cast_id = 2; // CastId of the Cast to react to
327
+
CastId target_cast_id = 2; // CastId being reacted to
328
+
string target_url = 3; // URL being reacted to
317
329
}
318
330
}
319
331
@@ -330,7 +342,7 @@ A Reaction message `m` must pass these validations and the validations for React
330
342
1.`m.signature_scheme` must be `SIGNATURE_SCHEME_ED25519`.
331
343
2.`m.data.body` must be `ReactionBody`.
332
344
3.`m.data.body.type` must be a valid, non-zero ReactionType
333
-
4.`m.data.body.target` must be a valid CastId
345
+
4.`m.data.body.target` must be a valid CastId or a UTF8 string between 1 and 256 bytes inclusive.
334
346
335
347
A ReactionAdd message `m` is valid only if it passes these validations:
0 commit comments