fix nick's in chat
This commit is contained in:
parent
8847e3a273
commit
596f2a1210
1 changed files with 2 additions and 1 deletions
|
|
@ -550,7 +550,8 @@ private _handle_message(el: Element) {
|
||||||
const from_full = msg.getAttribute('from') || ''
|
const from_full = msg.getAttribute('from') || ''
|
||||||
const slash = from_full.indexOf('/')
|
const slash = from_full.indexOf('/')
|
||||||
const from = slash >= 0 ? from_full.slice(0, slash) : from_full
|
const from = slash >= 0 ? from_full.slice(0, slash) : from_full
|
||||||
const nick = slash >= 0 ? from_full.slice(slash + 1) : undefined
|
// Only groupchat carries a meaningful nick after the slash; for 1:1 the resource is just a device id.
|
||||||
|
const nick = type === 'groupchat' && slash >= 0 ? from_full.slice(slash + 1) : undefined
|
||||||
this.on_mam_message?.({
|
this.on_mam_message?.({
|
||||||
id: result.getAttribute('id') || this._id(),
|
id: result.getAttribute('id') || this._id(),
|
||||||
from,
|
from,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue