Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

#473: Error message processing #474

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/core/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,11 +774,16 @@ Candy.Core.Event = (function(self, Strophe, $) {
message = { from: from, name: Strophe.getNodeFromJid(from), body: msg.children('subject').text(), type: 'subject' };
// Error messsage
} else if(msg.attr('type') === 'error') {
var error = msg.children('error');
if(error.children('text').length > 0) {
roomJid = partnerJid;
roomName = Strophe.getNodeFromJid(roomJid);
message = { from: msg.attr('from'), type: 'info', body: error.children('text').text() };
var error = msg.children("error");
roomJid = partnerJid;
roomName = Strophe.getNodeFromJid(roomJid);
message = {
from: msg.attr("from"),
name: "error",
body: error.children()[0].nodeName
};
if (error.text().trim().length > 0) {
message.body = error.children('text').text();
}
// Chat message
} else if(msg.children('body').length > 0) {
Expand Down