(
args: {
channelId: string;
topic: string;
},
config: E2eConfig | undefined,
)
| 5300 | } |
| 5301 | |
| 5302 | async function handleSetChannelTopic( |
| 5303 | args: { |
| 5304 | channelId: string; |
| 5305 | topic: string; |
| 5306 | }, |
| 5307 | config: E2eConfig | undefined, |
| 5308 | ) { |
| 5309 | const identity = getIdentity(config); |
| 5310 | if (!identity) { |
| 5311 | const channel = getMockChannel(args.channelId); |
| 5312 | const nextTopic = args.topic.trim(); |
| 5313 | |
| 5314 | channel.topic = nextTopic.length > 0 ? nextTopic : null; |
| 5315 | channel.topic_set_by = getMockMemberPubkey(config); |
| 5316 | channel.topic_set_at = new Date().toISOString(); |
| 5317 | touchMockChannel(channel); |
| 5318 | return; |
| 5319 | } |
| 5320 | |
| 5321 | await submitSignedEvent(config, { |
| 5322 | kind: 9002, |
| 5323 | content: "", |
| 5324 | tags: [ |
| 5325 | ["h", args.channelId], |
| 5326 | ["topic", args.topic], |
| 5327 | ], |
| 5328 | }); |
| 5329 | } |
| 5330 | |
| 5331 | async function handleSetChannelPurpose( |
| 5332 | args: { |
no test coverage detected