瀏覽代碼

Proper fix for pm and channel msgs with no space

tags/v0.4.3^2
Vildravn 4 年之前
父節點
當前提交
0ca95cec9e
共有 1 個文件被更改,包括 10 次插入14 次删除
  1. +10
    -14
      src/client/ui/templates/messages/messages.js

+ 10
- 14
src/client/ui/templates/messages/messages.js 查看文件

@@ -419,21 +419,17 @@ define([
return;

const firstChar = val[0];
this.lastChannel = ({
[firstChar]: null,
'@': val.substr(0, val.indexOf(' ')),
'$': val.substr(0, val.indexOf(' ')),
'%': '%'
})[firstChar];

// hacky: fix bug with messages with no space, e.g.
// $channel
// @name
if (this.lastChannel != null && this.lastChannel.length > 0) {
this.lastChannel += ' ';
}
let lastChannel = null;
if ('@$'.includes(firstChar)) {
const firstSpace = val.indexOf(' ');
if (firstSpace === -1)
lastChannel = val + ' ';
else
lastChannel = val.substr(0, firstSpace) + ' ';
} else if (firstChar === '%')
lastChannel = '%';

console.log(`-${this.lastChannel}-`);
this.lastChannel = lastChannel;

client.request({
cpn: 'social',


Loading…
取消
儲存