Commit 40da1d68 authored by Anshul Singhal's avatar Anshul Singhal Committed by JC Brand

Fixes #628. Bug in displaying chat status during private chat with carbons. (PR #801)



* Fixes the bug in displaying chat status during private chat(message carbons)

* Adds fix#628 to ChangeLog

* Changes Log added to version 3.0.1

* Makes the string alphanumeric

* Orders the logs with ticket number
parent 3dd6ff17
......@@ -2,6 +2,7 @@
## 3.0.1 (Unreleased)
- #628 Fixes the bug in displaying chat status during private chat. [saganshul]
- #806 The `_converse.listen` API event listeners aren't triggered. [jcbrand]
- #807 Error: Plugin "converse-dragresize" tried to override HeadlinesBoxView but it's not found. [jcbrand]
......
......@@ -892,7 +892,7 @@
expect(chatbox.messages.length).toEqual(1);
var msg_obj = chatbox.messages.models[0];
expect(msg_obj.get('message')).toEqual(msgtext);
expect(msg_obj.get('fullname')).toEqual(mock.cur_names[5]);
expect(msg_obj.get('fullname')).toEqual(_converse.xmppstatus.get('fullname'));
expect(msg_obj.get('sender')).toEqual('me');
expect(msg_obj.get('delayed')).toEqual(false);
// Now check that the message appears inside the chatbox in the DOM
......
......@@ -1369,7 +1369,7 @@
getMessageAttributes: function (message, delay, original_stanza) {
delay = delay || message.querySelector('delay');
var type = message.getAttribute('type'),
body, stamp, time, sender, from;
body, stamp, time, sender, from, fullname;
if (type === 'error') {
body = _.propertyOf(message.querySelector('error text'))('textContent');
......@@ -1377,7 +1377,6 @@
body = _.propertyOf(message.querySelector('body'))('textContent');
}
var delayed = !_.isNull(delay),
fullname = this.get('fullname'),
is_groupchat = type === 'groupchat',
chat_state = message.getElementsByTagName(_converse.COMPOSING).length && _converse.COMPOSING ||
message.getElementsByTagName(_converse.PAUSED).length && _converse.PAUSED ||
......@@ -1390,9 +1389,6 @@
} else {
from = Strophe.getBareJidFromJid(message.getAttribute('from'));
}
if (_.isEmpty(fullname)) {
fullname = from;
}
if (delayed) {
stamp = delay.getAttribute('stamp');
time = stamp;
......@@ -1401,8 +1397,10 @@
}
if ((is_groupchat && from === this.get('nick')) || (!is_groupchat && from === _converse.bare_jid)) {
sender = 'me';
fullname = _converse.xmppstatus.get('fullname') || from;
} else {
sender = 'them';
fullname = this.get('fullname') || from;
}
return {
'type': type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment