Skip to content

Commit eb6fff5

Browse files
committed
Update variable names and positioning.
1 parent 014a82d commit eb6fff5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

static/js/directives/chat.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
198198
var options = $.extend({}, opts);
199199
var subscope = controller.rooms[id];
200200
var index = controller.visibleRooms.length;
201-
var buddy = buddyData.lookup(id);
202201
if (!subscope) {
203202
console.log("Create new chatroom", [id]);
203+
var buddy = buddyData.lookup(id);
204204
if (settings.group) {
205205
controller.visibleRooms.unshift(id);
206206
} else {
@@ -220,9 +220,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
220220
subscope.p2pstate = false;
221221
subscope.active = false;
222222
subscope.pending = 0;
223-
subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid);
224-
subscope.iscontact = !!(buddy && buddy.contact);
225-
subscope.canAddContact = !subscope.isgroupchat && subscope.isuser;
223+
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid);
224+
subscope.isContact = !!(buddy && buddy.contact);
225+
subscope.canAddContact = !subscope.isgroupchat && subscope.isUser;
226226
if (!subscope.isgroupchat) {
227227
buddyData.push(id);
228228
}
@@ -349,7 +349,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
349349
contacts.remove(buddy.contact.Userid);
350350
};
351351
subscope.updateContactStatus = function(event, data) {
352-
subscope.iscontact = event.type === "contactadded";
352+
subscope.isContact = event.type === "contactadded";
353353
};
354354
contacts.e.on("contactadded", subscope.updateContactStatus);
355355
contacts.e.on("contactremoved", subscope.updateContactStatus);

static/partials/chatroom.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<button ng-if="!isgroupchat" class="btn btn-sm btn-primary" title="{{_('Start video call')}}" ng-click="doCall()"><i class="fa fa-phone fa-fw"></i></button>
66
<button class="btn btn-sm btn-primary btn-fileupload" title="{{_('Upload files')}}"><i class="fa fa-upload fa-fw"></i></button>
77
<button class="btn btn-sm btn-primary btn-locationshare" title="{{_('Share my location')}}" ng-click="shareGeolocation()"><i class="fa fa-location-arrow fa-fw"></i></button>
8-
<button ng-if="canAddContact && !iscontact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
9-
<button ng-if="canAddContact && iscontact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
8+
<button ng-if="canAddContact && !isContact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
9+
<button ng-if="canAddContact && isContact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
1010
</div>
1111
<div class="btn-group pull-right">
1212
<button class="btn btn-sm btn-default" title="{{_('Clear chat')}}" ng-click="doClear()"><i class="fa fa-eraser fa-fw"></i></button>

0 commit comments

Comments
 (0)