MCPcopy Create free account
hub / github.com/block/buzz / handleSetChannelTopic

Function handleSetChannelTopic

desktop/src/testing/e2eBridge.ts:5302–5329  ·  view source on GitHub ↗
(
  args: {
    channelId: string;
    topic: string;
  },
  config: E2eConfig | undefined,
)

Source from the content-addressed store, hash-verified

5300}
5301
5302async 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
5331async function handleSetChannelPurpose(
5332 args: {

Callers 1

handleMockCommandFunction · 0.85

Calls 5

getMockChannelFunction · 0.85
getMockMemberPubkeyFunction · 0.85
touchMockChannelFunction · 0.85
submitSignedEventFunction · 0.85
getIdentityFunction · 0.70

Tested by

no test coverage detected