mirror of https://github.com/vector-im/riot-web
Merge pull request #4154 from matrix-org/t3chguy/whois_cmd
Add /whois SlashCommand to open UserInfopull/21833/head
commit
6ba9f78888
|
@ -893,6 +893,26 @@ export const CommandMap = {
|
|||
},
|
||||
category: CommandCategories.advanced,
|
||||
}),
|
||||
|
||||
whois: new Command({
|
||||
name: "whois",
|
||||
description: _td("Displays information about a user"),
|
||||
args: '<user-id>',
|
||||
runFn: function(roomId, userId) {
|
||||
if (!userId || !userId.startsWith("@") || !userId.includes(":")) {
|
||||
return reject(this.getUsage());
|
||||
}
|
||||
|
||||
const member = MatrixClientPeg.get().getRoom(roomId).getMember(userId);
|
||||
|
||||
dis.dispatch({
|
||||
action: 'view_user',
|
||||
member: member || {userId},
|
||||
});
|
||||
return success();
|
||||
},
|
||||
category: CommandCategories.advanced,
|
||||
}),
|
||||
};
|
||||
/* eslint-enable babel/no-invalid-this */
|
||||
|
||||
|
|
|
@ -204,6 +204,7 @@
|
|||
"Sends the given message coloured as a rainbow": "Sends the given message coloured as a rainbow",
|
||||
"Sends the given emote coloured as a rainbow": "Sends the given emote coloured as a rainbow",
|
||||
"Displays list of commands with usages and descriptions": "Displays list of commands with usages and descriptions",
|
||||
"Displays information about a user": "Displays information about a user",
|
||||
"Reason": "Reason",
|
||||
"%(targetName)s accepted the invitation for %(displayName)s.": "%(targetName)s accepted the invitation for %(displayName)s.",
|
||||
"%(targetName)s accepted an invitation.": "%(targetName)s accepted an invitation.",
|
||||
|
|
Loading…
Reference in New Issue