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

Function handleJoinChannel

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

Source from the content-addressed store, hash-verified

5577}
5578
5579async function handleJoinChannel(
5580 args: {
5581 channelId: string;
5582 },
5583 config: E2eConfig | undefined,
5584) {
5585 const identity = getIdentity(config);
5586 if (!identity) {
5587 const channel = getMockChannel(args.channelId);
5588 const currentPubkey = getMockMemberPubkey(config);
5589
5590 if (channel.members.some((member) => member.pubkey === currentPubkey)) {
5591 return;
5592 }
5593
5594 channel.members.push(createCurrentMember(config, "member"));
5595 syncMockChannel(channel);
5596 touchMockChannel(channel);
5597 return;
5598 }
5599
5600 await submitSignedEvent(config, {
5601 kind: 9021,
5602 content: "",
5603 tags: [["h", args.channelId]],
5604 });
5605}
5606
5607async function handleLeaveChannel(
5608 args: {

Callers 1

handleMockCommandFunction · 0.85

Calls 8

getMockChannelFunction · 0.85
getMockMemberPubkeyFunction · 0.85
createCurrentMemberFunction · 0.85
syncMockChannelFunction · 0.85
touchMockChannelFunction · 0.85
submitSignedEventFunction · 0.85
pushMethod · 0.80
getIdentityFunction · 0.70

Tested by

no test coverage detected