Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for @-mentions across platforms. #1992

Open
cleverdevil opened this issue Feb 4, 2018 · 5 comments

Comments

Projects
4 participants
@cleverdevil
Copy link
Contributor

commented Feb 4, 2018

With the advent of Micro.blog, I'm starting to run into issues with how Known implements @-mentions and "replies." I'd love some direction on the best way to handle it. For reference, here is Micro.blog's instruction on how to @-mention and reply from an externally hosted site.

In my ideal world, when I @-mention someone in a Status/Reply, I'd like the ability to specify the target that I am mentioning with a link, as Micro.blog suggests. The issue is that, as far as I can tell, Status and Reply objects only support plain-text content, not HTML content.

Again, I'd love @mapkyca and @benwerd to chime in here with some directional feedback, if and when they have time. I know you're both busy, so no rush! But, given some direction, I can work on a pull request to support this use case.

(Related: I'd like to eventually implement shortcuts for @-mentioning Twitter, Micro.blog, and the broader IndieWeb).

@jgmac1106

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2018

@cleverdevil talking to @eddie and @aaronpk about this in terms of of "nickname database" this might be related ro @mapkyca following work he did on the earlier exploration of reader subscription.

The general idea in my mind is I publish a follow post type -u-follow-of to someone's homepage. If an h-card exist on the homepage any u-url is parsed and the nickname database populated.

Then depending on how I syndicate, if I @ mention @cleverdevil but your are different nick on micro.blog the correct link will be sent in syndication.

@benwerd benwerd added this to To do in Known 1.0 Oct 25, 2018

@cleverdevil

This comment has been minimized.

Copy link
Contributor Author

commented Nov 2, 2018

So, as @benwerd and @mapkyca think about how to implement this, I've gone ahead and done some tinkering and implemented a little service in my CleverCustomize plugin (not committed to the official repo yet) that could potentially help improve @-mentions across services:

https://gist.github.com/cleverdevil/17a5cea3cb8d81c43404de169720a8df

You can try it out here:

https://cleverdevil.io/nicknames?url=https://werd.io

The idea is that a user in Known could compose an @-mention using a domain name, and Known would then properly transform that @-mention based upon how that content is being syndicated. For example, if I published the following note:

Hey @{werd.io}, how are things going?

... my service would look up @benwerd's h-card and rel=me links from his website, and then return the following:

[
    {
        "type": "twitter",
        "username": "benwerd",
        "url": "http://twitter.com/benwerd",
        "mention": {
            "html": "<a href=\"https://twitter.com/benwerd\">Ben Werdmüller</a>",
            "text": "@benwerd"
        }
    },
    {
        "type": "github",
        "username": "benwerd",
        "url": "https://github.com/benwerd",
        "mention": {
            "html": "<a href=\"https://github.com/benwerd\">Ben Werdmüller</a>",
            "text": "@benwerd"
        }
    },
    {
        "type": "linkedin",
        "username": "benwerd",
        "url": "http://www.linkedin.com/in/benwerd",
        "mention": {
            "html": "<a href=\"https://www.linkedin.com/in/benwerd\">Ben Werdmüller</a>",
            "text": "@benwerd"
        }
    },
    {
        "type": "instagram",
        "username": "ben.werdmuller",
        "url": "https://instagram.com/ben.werdmuller",
        "mention": {
            "html": "<a href=\"https://instagram.com/ben.werdmuller\">Ben Werdmüller</a>",
            "text": "@ben.werdmuller"
        }
    }
]

If I toggled syndication to Twitter on the post, the syndicated version would automatically transform to Ben's Twitter username to properly mention him on that particular silo. Similarly, if I syndicated to Micro.blog, I could theoretically mention Ben on that service if he had a username there. If he didn't have a username, Known could simply transform into a hyperlink (<a href="https://werd.io"> Ben Werdmüller</a>).

Eventually, it'd also be nice for Known to have a sort of contacts database with nicknames/petnames for people ("Mom," "Dad," "Lacey," "Ben," etc.) that would be used instead of the parsed h-card's name property.

@mapkyca

This comment has been minimized.

Copy link
Member

commented Mar 23, 2019

Hi, just swinging back to this. I'd be keen to look at any PRs.

Some notes and thoughts:

  • Mention.js is currently disabled, not sure why (perhaps @benwerd can supply context), but as of time of writing it's a deletion candidate (#2364) because it's been disabled for so long.
  • The @-mention js points to a search endpoint, so it'd make sense to reuse this somehow
  • The nicknames db should also probably handle local users too (perhaps this could be handled between the difference between @mapkyca and @{mapkyca.com} )
  • The friend/follow stuff is still there, but has probably suffered some bitrot. If we're going to reuse this it'd make sense to reuse some of the parsing / follow stuff and bring it into a nicer workflow. So far you can follow a url (which works off a bookmarklet - obviously needs to be done better), and then MF2 is parsed, with a UI to allow you to edit and fill in any blanks. Crucially, the UX is a bit clunky, and we need to do a "proper" engineering job on it - i.e. make the code reusable and not have it stuck in the action endpoint.
  • Crucially, the friend/follow stuff works off the concept of a RemoteUser, which is an entity that already exists. So, it would make sense if this was reused.

Like I said, I would love to look at PRs for this, especially if it means dusting off some of the friend follow stuff. This has always been on my "copious amounts of free time" list, but I've never had a chance to get to it.

@lindner

This comment has been minimized.

Copy link
Contributor

commented Apr 17, 2019

Another upvote for this. When you gateway to both twitter and mastodon it gets confusing which @ handle you're referring to.

Even just supporting @foo@twitter.com etc would be an improvement.

@mapkyca

This comment has been minimized.

Copy link
Member

commented Apr 17, 2019

Id be tempted to add a hook to the search endpoint for this and let service plugins (twitter, etc) handle this and extend the search results.

I could at least look at that, but I'm not sure I'd get much further than this... like I said, PRs welcome!

mapkyca added a commit to mapkyca/idno that referenced this issue Apr 21, 2019

Adding search hook on mentions endpoint for extension
It would be handy to improve user search and cross platform mentions. I don't have time to necessarily do this right now, but others have expressed an interest. This should make it easier for them.

Refs idno#2364
Refs idno#1992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.