Implement remote account resolution
This commit is contained in:
parent
bee892d446
commit
68ce6d5748
73 changed files with 735 additions and 334 deletions
|
|
@ -1,14 +1,17 @@
|
|||
/**
|
||||
* Mention
|
||||
*/
|
||||
import parseAcct from '../../../../common/user/parse-acct';
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^@[a-zA-Z0-9\-]+/);
|
||||
const match = text.match(/^(?:@[a-zA-Z0-9\-]+){1,2}/);
|
||||
if (!match) return null;
|
||||
const mention = match[0];
|
||||
const { username, host } = parseAcct(mention.substr(1));
|
||||
return {
|
||||
type: 'mention',
|
||||
content: mention,
|
||||
username: mention.substr(1)
|
||||
username,
|
||||
host
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue