1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 20:30:05 +08:00

fix(chat): display username instead

This commit is contained in:
wsdjeg 2022-05-09 12:03:00 +08:00
parent 0b5e3f75a5
commit 8621b5b2d3

View File

@ -380,7 +380,7 @@ function! s:update_msg_screen() abort
let msgs = filter(deepcopy(s:messages), '(!empty(v:val["room"]) && v:val["room"] ==# s:current_channel) ||'
\ . ' (empty(v:val["room"]) && has_key(v:val, "protocol") && v:val["protocol"] ==# s:protocol)')
for msg in msgs
let name = s:get_str_with_width(msg['user'], 13)
let name = s:get_str_with_width(msg['username'], 13)
let message = s:get_lines_with_width(msg['msg'], winwidth('$') - 36)
let first_line = '[' . msg['time'] . '] ' . nr2char(9474) . repeat(' ', 13 - strwidth(name)) . name . ' ' . nr2char(9474) . ' ' . message[0]
call add(buffer, first_line)