adsr/irslackd

Simplify mpdm channel names

fancypantalons opened this issue · 4 comments

I've got a prototype implementation if this sounds interesting.

From a UX perspective, mpdm channel names are... definitely a nuisance, following a pattern like:

#mpdm-myself--alice--bob--charlie

I'm experimenting with an alternative mapping that uses the server local chantype '&', eliminates the user's own nickname, and then pulls out the extra hyphens as follows:

&alice-bob-charlie

(Yeah, this isn't really what the '&' chantype is for, but in this context I think it's fine to use it). The benefit here is brevity. The channels are still distinguishable from non-mpdm channels (now by chantype prefix), but they're not nearly as unwieldy.

Obviously this would be a jarring change for existing users so I'd propose a refactoring to centralize the logic for:

  1. Testing if a conversation name represents a channel (right now there's prefix checks all over the place, and it'd be good to put that in one place).
  2. Testing if an IRC channel name maps to a group convo.
  3. Mapping a Slack conversation name to a channel name (this seems to be repeated in a few different places).

Then, make the behaviour switchable with an opt-in command-line flag or other setting if that's desirable.

Thoughts?

adsr commented

Yes, definitely opportunities to DRY up the code. Shortening mpdm channel names sounds good to me too. Thanks @fancypantalons.

Apologies for the spam, this is what I get for not updating and running the UTs before pushing to my repo...

Anyway, a4d8a79 is in good shape, now, I think. I've added an additional test to test_mpim.js and everything passes now after I hunted down a couple regressions.

adsr commented

Excellent. I'll go through these next time I'm at a computer.

adsr commented

Merged in 86d6e94. Thanks!