Bugfix for incorrect roster height when allow_contact_requests=false.

Also update changelog and fix some linting errors.

Fixes #360
This commit is contained in:
JC Brand 2015-04-08 13:12:29 +02:00
parent abae9ad6c0
commit b177a6a7a0
4 changed files with 17 additions and 6 deletions

View File

@ -3810,7 +3810,6 @@
handleIncomingSubscription: function (jid) {
var bare_jid = Strophe.getBareJidFromJid(jid);
var item = this.get(bare_jid);
if (!converse.allow_contact_requests) {
converse.connection.roster.unauthorize(bare_jid);
return true;
@ -4148,6 +4147,11 @@
label_contacts: LABEL_CONTACTS,
label_groups: LABEL_GROUPS
}));
if (!converse.allow_contact_requests) {
// XXX: if we ever support live editing of config then
// we'll need to be able to remove this class on the fly.
this.$el.addClass('no-contact-requests');
}
return this;
},
@ -5546,7 +5550,7 @@
'rooms': {
'open': function (jids, nick) {
if (!nick) {
nick = Strophe.getNodeFromJid(converse.bare_jid)
nick = Strophe.getNodeFromJid(converse.bare_jid);
}
if (typeof nick !== "string") {
throw new TypeError('rooms.open: invalid nick, must be string');
@ -5555,7 +5559,7 @@
var chatroom = converse.chatboxes.get(jid);
converse.log('jid');
if (!chatroom) {
var chatroom = converse.chatboxviews.showChat({
chatroom = converse.chatboxviews.showChat({
'id': jid,
'jid': jid,
'name': Strophe.unescapeNode(Strophe.getNodeFromJid(jid)),
@ -5576,7 +5580,6 @@
'get': function (jids) {
if (typeof jids === "undefined") {
throw new TypeError("rooms.get: You need to provide at least one JID");
return null;
} else if (typeof jids === "string") {
return getWrappedChatBox(jids);
}

View File

@ -677,10 +677,12 @@
position: relative;
margin: 0.5em 0 0 0;
height: 194px;
height: calc(100% - 68px);
height: calc(100% - 50px - 20px);
overflow: hidden;
/* (jQ addClass:) if input has value: */
/* (jQ addClass:) if mouse is over the 'x' input area*/ }
#conversejs #converse-roster.no-contact-requests {
height: calc(100% - 25px - 20px); }
#conversejs #converse-roster .filter-type {
display: table-cell;
float: right;

View File

@ -11,6 +11,8 @@ Changelog
* #357 Fix the known bug where a state notification reopens a chat box. [floriancargoet]
* #358 Bugfix. Chat rooms show the same occupants bug. [floriancargoet]
* #359 Fix a timeout bug in chat state notifications. [floriancargoet]
* #360 Incorrect roster height when ``allow_contact_requests=true``. [floriancargoet, jcbrand]
* #362 Add API for retrieving and opening rooms. [pzia]
* #364 Text selection in chat boxes not shown in Firefox. [jcbrand]
0.9.1 (2015-03-26)

View File

@ -740,9 +740,13 @@
position: relative;
margin: 0.5em 0 0 0;
height: $roster-height;
height: calc(100% - 68px);
height: calc(100% - #{$controlbox-dropdown-height*2} - 20px);
overflow: hidden;
&.no-contact-requests {
height: calc(100% - #{$controlbox-dropdown-height} - 20px);
}
.filter-type {
display: table-cell;
float: right;