diff --git a/src/commands/InviteCommand.ts b/src/commands/InviteCommand.ts index 32cf63c..7fe4616 100644 --- a/src/commands/InviteCommand.ts +++ b/src/commands/InviteCommand.ts @@ -140,8 +140,14 @@ export class InviteCommand implements ICommand { // List of Matrix user IDs that have already joined const effectiveJoinedUserIds: string[] = members.filter(m => m.effectiveMembership === "join").map(m => m.membershipFor); for (const target of people) { - if (target.mxid && effectiveJoinedUserIds.includes(target.mxid)) continue; - if (emailInvitePersonIds.includes(target.person.id)) continue; + if (target.mxid) { + if (effectiveJoinedUserIds.includes(target.mxid)) continue; + } else { + // Notably: don't stop Matrix-inviting a user just because they had + // previously been e-mail-invited + if (emailInvitePersonIds.includes(target.person.id)) continue; + } + try { await invitePersonToRoom(this.client, target, roomId, this.config); } catch (e) { diff --git a/src/commands/VerifyCommand.ts b/src/commands/VerifyCommand.ts index 2414c8c..5ce2d00 100644 --- a/src/commands/VerifyCommand.ts +++ b/src/commands/VerifyCommand.ts @@ -31,7 +31,7 @@ interface PersonState { bestKind: 'matrix' | 'e-mail' | 'uncontactable', // what's the current state of this person in this room? - membership: 'invited' | 'joined' | 'missing' + membership: 'invited' | 'joined' | 'missing' | 'invited-but-by-e-mail' } export class VerifyCommand implements ICommand { @@ -70,7 +70,7 @@ export class VerifyCommand implements ICommand { let state =peopleToStates.get(target.id); if (state) { - html += ` (best contact method: ${state.bestKind}; membership: ${state.membership})`; + html += ` (best method: ${state.bestKind}; membership: ${state.membership})`; } else { html += " (unknown state)"; } @@ -122,7 +122,7 @@ export class VerifyCommand implements ICommand { const effectiveInvitedUserIds: string[] = members.filter(m => m.effectiveMembership === "invite").map(m => m.membershipFor); for (const person of resolved) { let bestKind: 'matrix' | 'e-mail' | 'uncontactable' = 'uncontactable'; - let state: 'invited' | 'joined' | 'missing' = 'missing'; + let state: 'invited' | 'joined' | 'missing' | 'invited-but-by-e-mail' = 'missing'; if (person.mxid) { bestKind = 'matrix'; @@ -130,6 +130,8 @@ export class VerifyCommand implements ICommand { state = 'joined'; } else if (effectiveInvitedUserIds.includes(person.mxid)) { state = 'invited'; + } else if (emailInvitePersonIds.includes(person.person.id)) { + state = 'invited-but-by-e-mail'; } } else if (person.emails) { bestKind = 'e-mail';