Update command strings

This commit is contained in:
Ajay Bura 2022-09-11 08:27:59 +05:30
parent 831bb83f4e
commit 29ddcfa1f9
3 changed files with 6 additions and 9 deletions

View file

@ -9,8 +9,6 @@ on:
jobs: jobs:
docker-build: docker-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
env:
PR_NUMBER: ${{github.event.number}}
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3.0.2 uses: actions/checkout@v3.0.2

View file

@ -20,7 +20,6 @@ function ProfileEditor({ userId }) {
const [isEditing, setIsEditing] = useState(false); const [isEditing, setIsEditing] = useState(false);
const mx = initMatrix.matrixClient; const mx = initMatrix.matrixClient;
const user = mx.getUser(mx.getUserId()); const user = mx.getUser(mx.getUserId());
const fallbackUsername = userId.match(/^@?(\S+):(\S+)$/)[1];
const displayNameRef = useRef(null); const displayNameRef = useRef(null);
const [avatarSrc, setAvatarSrc] = useState(user.avatarUrl ? mx.mxcUrlToHttp(user.avatarUrl, 80, 80, 'crop') : null); const [avatarSrc, setAvatarSrc] = useState(user.avatarUrl ? mx.mxcUrlToHttp(user.avatarUrl, 80, 80, 'crop') : null);
@ -96,7 +95,7 @@ function ProfileEditor({ userId }) {
const renderInfo = () => ( const renderInfo = () => (
<div className="profile-editor__info" style={{ marginBottom: avatarSrc ? '24px' : '0' }}> <div className="profile-editor__info" style={{ marginBottom: avatarSrc ? '24px' : '0' }}>
<div> <div>
<Text variant="h2" primary weight="medium">{twemojify(username) ?? fallbackUsername}</Text> <Text variant="h2" primary weight="medium">{twemojify(username) ?? userId}</Text>
<IconButton <IconButton
src={PencilIC} src={PencilIC}
size="extra-small" size="extra-small"
@ -111,7 +110,7 @@ function ProfileEditor({ userId }) {
return ( return (
<div className="profile-editor"> <div className="profile-editor">
<ImageUpload <ImageUpload
text={username ?? fallbackUsername} text={username ?? userId}
bgColor={colorMXID(userId)} bgColor={colorMXID(userId)}
imageSrc={avatarSrc} imageSrc={avatarSrc}
onUpload={handleAvatarUpload} onUpload={handleAvatarUpload}

View file

@ -57,7 +57,7 @@ const commands = {
}, },
startdm: { startdm: {
name: 'startdm', name: 'startdm',
description: 'Start DM with user. Example: /startdm userId1 userId2', description: 'Start direct message with user. Example: /startdm userId1',
exe: async (roomId, data) => { exe: async (roomId, data) => {
const mx = initMatrix.matrixClient; const mx = initMatrix.matrixClient;
const rawIds = data.split(' '); const rawIds = data.split(' ');
@ -78,7 +78,7 @@ const commands = {
}, },
join: { join: {
name: 'join', name: 'join',
description: 'Join room with alias. Example: /join alias1 alias2', description: 'Join room with address. Example: /join address1 address2',
exe: (roomId, data) => { exe: (roomId, data) => {
const rawIds = data.split(' '); const rawIds = data.split(' ');
const roomIds = rawIds.filter((id) => id.match(ROOM_ID_ALIAS_REG)); const roomIds = rawIds.filter((id) => id.match(ROOM_ID_ALIAS_REG));
@ -159,7 +159,7 @@ const commands = {
}, },
myroomnick: { myroomnick: {
name: 'myroomnick', name: 'myroomnick',
description: 'Change my room nick', description: 'Change nick in current room.',
exe: (roomId, data) => { exe: (roomId, data) => {
const nick = data.trim(); const nick = data.trim();
if (nick === '') return; if (nick === '') return;
@ -168,7 +168,7 @@ const commands = {
}, },
myroomavatar: { myroomavatar: {
name: 'myroomavatar', name: 'myroomavatar',
description: 'Change my room avatar. Example /myroomavatar mxc://xyzabc', description: 'Change profile picture in current room. Example /myroomavatar mxc://xyzabc',
exe: (roomId, data) => { exe: (roomId, data) => {
if (data.match(MXC_REG)) { if (data.match(MXC_REG)) {
roomActions.setMyRoomAvatar(roomId, data); roomActions.setMyRoomAvatar(roomId, data);