Support sending %exp messages

This commit is contained in:
Fang 2019-07-31 13:35:25 +02:00
parent f463ae2839
commit 1ce3d5af7a
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -116,7 +116,9 @@ export class ChatInput extends Component {
}
getSpeechType(input) {
if (input.indexOf('\n') >= 0) {
if (input[0] === '#') {
return 'exp';
} else if (input.indexOf('\n') >= 0) {
return 'fat';
} else if (input[0] === '@') {
return 'lin@';
@ -133,6 +135,8 @@ export class ChatInput extends Component {
return 'fs-italic';
case 'url':
return 'td-underline';
case 'exp':
return 'code';
case 'fat':
if (clipboard) return 'code';
default:
@ -198,6 +202,18 @@ export class ChatInput extends Component {
case 'url':
return this.globalizeUrl(content);
//
case 'exp':
// remove leading #
content = content.slice(1);
// remove insignificant leading whitespace.
// aces might be relevant to style.
while (content[0] === '\n') {
content = content.slice(1);
}
return { exp: {
exp: content
} };
//
case 'fat':
// clipboard contents
if (clipboard !== null) {