Skip to content

slack user email names getting injected into text, replacing organization name #268

Description

@pinheadmz

Our organization is called bcoin. One of our users has signed up to slack with an email address in their own domain, as many savvy people do who want to to monitor how their email addresses are leaked or shared.

Username: HeyFakename
Email address: bcoin@heyfakename.com

The result is, whenever anyone types bcoin into IRC (which we do a lot... because that's the name of the project AND the IRC channel #bcoin) in Slack the word gets replaced with the user's slack handle.

Example:

IRC: Hey guys I really enjoy using bcoin for my project
-->
Slack: Hey guys I really enjoy using @HeyFakename for my project

I was able to prevent this in most cases by just pulling out this regex replacement (I'm not concerned with IRC users trying to "@" slack users):

slack-irc/lib/bot.js

Lines 165 to 168 in a549f5a

.replace(/<@(U\w+)\|?(\w+)?>/g, (match, userId, readable) => {
const { name } = dataStore.getUserById(userId);
return readable || `@${name}`;
})

There is still a lingering issue where if an IRC user types exactly @bcoin, then Slack will replace that with @HeyFakename anyway... but I think that might just be a Slack thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions