Fetch the user's vcard when you subscribe to them

This commit is contained in:
JC Brand 2013-04-20 15:13:42 +02:00
parent cb2dab38fd
commit 6de997681b
2 changed files with 25 additions and 4 deletions

View File

@ -182,6 +182,10 @@ div.delayed .chat-message-me {
color: #7EABBB;
}
input.error {
border: 1px solid red;
}
.chat-message-error {
color:#76797C;
font-size:90%;
@ -596,8 +600,9 @@ form.sendXMPPMessage {
height: 54px;
}
#set-custom-xmpp-status {
form#set-custom-xmpp-status {
float: left;
padding: 0;
}
#set-custom-xmpp-status button {
@ -617,7 +622,16 @@ div.xmpp-status {
}
input.custom-xmpp-status {
height: 18px;
width: 138px;
}
form.add-xmpp-contact {
background: white;
padding: 5px;
}
form.add-xmpp-contact input {
width: 130px;
}
.fancy-dropdown {

View File

@ -654,8 +654,15 @@
addContactFromForm: function (ev) {
ev.preventDefault();
var $input = $(ev.target).find('input');
var jid = $input.val();
if (jid.indexOf("@") < 0) {
// this is not a valid JID
$input.addClass('error');
return;
}
converse.getVCard(
$(ev.target).find('input').val(),
jid,
$.proxy(function (jid, fullname, image, image_type, url) {
// XXX: Should we perhaps create a roster item here?
this.addContact(jid, fullname);