(
args: {
channelId: string;
},
config: E2eConfig | undefined,
)
| 5577 | } |
| 5578 | |
| 5579 | async 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 | |
| 5607 | async function handleLeaveChannel( |
| 5608 | args: { |
no test coverage detected