Skip to content

Commit ec20c7f

Browse files
authored
Use MSC4407 as the unstable prefix for sticky event capabilities (#159)
* Use MSC4407 as the unstable prefix for sticky event capabilities I realized that these capabilities would need their own MSC separate from the actual sticky event MSC, and Timo has kindly gone and drafted one. Changing these experimental identifiers while they're still hot off the press. * Remove unused, unspecified widget action
1 parent d40dc95 commit ec20c7f

6 files changed

Lines changed: 10 additions & 15 deletions

File tree

src/ClientWidgetApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,9 @@ export class ClientWidgetApi extends EventEmitter {
607607
}
608608

609609
const isStickyEvent = request.data.sticky_duration_ms !== undefined;
610-
if (isStickyEvent && !this.hasCapability(MatrixCapabilities.MSC4354SendStickyEvent)) {
610+
if (isStickyEvent && !this.hasCapability(MatrixCapabilities.MSC4407SendStickyEvent)) {
611611
return this.transport.reply<IWidgetApiErrorResponseData>(request, {
612-
error: { message: `Missing capability for ${MatrixCapabilities.MSC4354SendStickyEvent}` },
612+
error: { message: `Missing capability for ${MatrixCapabilities.MSC4407SendStickyEvent}` },
613613
});
614614
}
615615

src/driver/WidgetDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export abstract class WidgetDriver {
110110
}
111111

112112
/**
113-
* @experimental Part of MSC4354
113+
* @experimental Part of MSC4407
114114
* Sends a sticky event into a room. If `roomId` is falsy, the client should send the event
115115
* into the room the user is currently looking at. The widget API will have already
116116
* verified that the widget is capable of sending the event to that room.
@@ -163,7 +163,7 @@ export abstract class WidgetDriver {
163163
}
164164

165165
/**
166-
* @experimental Part of MSC4140, MSC4157 and MSC4354
166+
* @experimental Part of MSC4140, MSC4157 and MSC4407
167167
* Sends a delayed sticky event into a room. If `roomId` is falsy, the client should send the event
168168
* into the room the user is currently looking at. The widget API will have already
169169
* verified that the widget is capable of sending the event to that room.

src/interfaces/Capabilities.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export enum MatrixCapabilities {
5656
/**
5757
* @experimental It is not recommended to rely on this existing - it can be removed without notice.
5858
*/
59-
MSC4354SendStickyEvent = "org.matrix.msc4354.send_sticky_event",
59+
MSC4407SendStickyEvent = "org.matrix.msc4407.send.sticky_event",
6060
/**
6161
* @experimental It is not recommended to rely on this existing - it can be removed without notice.
6262
*/
63-
MSC4354ReceiveStickyEvent = "org.matrix.msc4354.receive_sticky_event",
63+
MSC4407ReceiveStickyEvent = "org.matrix.msc4407.receive.sticky_event",
6464
}
6565

6666
export type Capability = MatrixCapabilities | string;

src/interfaces/SendEventAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface ISendEventFromWidgetRequestData extends IWidgetApiRequestData {
2929
delay?: number; // eslint-disable-line camelcase
3030
parent_delay_id?: string; // eslint-disable-line camelcase
3131

32-
// MSC4354SendStickyEvent
32+
// MSC4407
3333
sticky_duration_ms?: number;
3434
}
3535

src/interfaces/WidgetApiAction.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ export enum WidgetApiFromWidgetAction {
9292
* @experimental It is not recommended to rely on this existing - it can be removed without notice.
9393
*/
9494
MSC4157UpdateDelayedEvent = "org.matrix.msc4157.update_delayed_event",
95-
96-
/**
97-
* @experimental It is not recommended to rely on this existing - it can be removed without notice.
98-
*/
99-
MSC4354SendStickyEvent = "org.matrix.msc4354.send_sticky_event",
10095
}
10196

10297
export type WidgetApiAction = WidgetApiToWidgetAction | WidgetApiFromWidgetAction | string;

test/ClientWidgetApi-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ describe("ClientWidgetApi", () => {
771771
await loadIframe([
772772
`org.matrix.msc2762.timeline:${event.data.room_id}`,
773773
`org.matrix.msc2762.send.event:${event.data.type}`,
774-
MatrixCapabilities.MSC4354SendStickyEvent,
774+
MatrixCapabilities.MSC4407SendStickyEvent,
775775
]);
776776

777777
emitEvent(new CustomEvent("", { detail: event }));
@@ -822,7 +822,7 @@ describe("ClientWidgetApi", () => {
822822
`org.matrix.msc2762.timeline:${event.data.room_id}`,
823823
`org.matrix.msc2762.send.event:${event.data.type}`,
824824
MatrixCapabilities.MSC4157SendDelayedEvent,
825-
MatrixCapabilities.MSC4354SendStickyEvent,
825+
MatrixCapabilities.MSC4407SendStickyEvent,
826826
]);
827827

828828
emitEvent(new CustomEvent("", { detail: event }));
@@ -871,7 +871,7 @@ describe("ClientWidgetApi", () => {
871871
await loadIframe([
872872
`org.matrix.msc2762.timeline:${event.data.room_id}`,
873873
`org.matrix.msc2762.send.state_event:${event.data.type}`,
874-
MatrixCapabilities.MSC4354SendStickyEvent,
874+
MatrixCapabilities.MSC4407SendStickyEvent,
875875
]);
876876

877877
emitEvent(new CustomEvent("", { detail: event }));

0 commit comments

Comments
 (0)