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; color: #7EABBB;
} }
input.error {
border: 1px solid red;
}
.chat-message-error { .chat-message-error {
color:#76797C; color:#76797C;
font-size:90%; font-size:90%;
@ -272,7 +276,7 @@ dt#xmpp-contact-search {
ul#found-users { ul#found-users {
padding: 10px 0 5px 5px; padding: 10px 0 5px 5px;
border: 0; border: 0;
} }
form.search-xmpp-contact { form.search-xmpp-contact {
@ -596,8 +600,9 @@ form.sendXMPPMessage {
height: 54px; height: 54px;
} }
#set-custom-xmpp-status { form#set-custom-xmpp-status {
float: left; float: left;
padding: 0;
} }
#set-custom-xmpp-status button { #set-custom-xmpp-status button {
@ -617,7 +622,16 @@ div.xmpp-status {
} }
input.custom-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 { .fancy-dropdown {

View File

@ -654,8 +654,15 @@
addContactFromForm: function (ev) { addContactFromForm: function (ev) {
ev.preventDefault(); 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( converse.getVCard(
$(ev.target).find('input').val(), jid,
$.proxy(function (jid, fullname, image, image_type, url) { $.proxy(function (jid, fullname, image, image_type, url) {
// XXX: Should we perhaps create a roster item here? // XXX: Should we perhaps create a roster item here?
this.addContact(jid, fullname); this.addContact(jid, fullname);