From b158c328dd5fe7459d59f589c4fa5889b9450ed3 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sat, 30 Aug 2014 17:56:45 +0200 Subject: [PATCH] Include reason for invite, if there is one. updates #215 --- converse.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/converse.js b/converse.js index e606ee52e..d14c4e2b8 100644 --- a/converse.js +++ b/converse.js @@ -2536,10 +2536,20 @@ $x = $message.children('x[xmlns="jabber:x:conference"]'), from = Strophe.getBareJidFromJid($message.attr('from')), room_jid = $x.attr('jid'), + reason = $x.attr('reason'), contact = converse.roster.get(from), + result; + + if (reason) { result = confirm( - __(___("%1$s has invited you to join a chat room: %2$s"), contact.get('fullname'), room_jid) + ___("%1$s has invited you to join a chat room: %2$s", contact.get('fullname'), room_jid) ); + } else { + result = confirm( + ___('%1$s has invited you to join a chat room: %2$s, and left the following reason: "%2$s"', + contact.get('fullname'), room_jid, reason) + ); + } if (result === true) { // TODO: Give user option to choose nickname? var chatroom = converse.chatboxviews.showChat({