Browse Source

Simplified function definition.

pull/100/head
Simon Eisenmann 11 years ago
parent
commit
8337b3eff9
  1. 32
      static/js/controllers/mediastreamcontroller.js

32
static/js/controllers/mediastreamcontroller.js

@ -182,23 +182,21 @@ define(['underscore', 'bigscreen', 'moment', 'sjcl', 'modernizr', 'webrtc.adapte
return $scope.status; return $scope.status;
}; };
$scope.updateStatus = (function() { $scope.updateStatus = function() {
return function() { // This is the user status.
// This is the user status. var status = {
var status = { displayName: $scope.master.displayName || null,
displayName: $scope.master.displayName || null, buddyPicture: $scope.master.buddyPicture || null,
buddyPicture: $scope.master.buddyPicture || null, message: $scope.master.message || null
message: $scope.master.message || null }
} if (_.isEqual(status, cache.status)) {
if (_.isEqual(status, cache.status)) { console.log("Status update skipped, as status has not changed.")
console.log("Status update skipped, as status has not changed.") } else {
} else { console.log("Updating own status", status);
console.log("Updating own status", status); mediaStream.api.updateStatus(status);
mediaStream.api.updateStatus(status); cache.status = _.clone(status);
cache.status = _.clone(status); }
} };
};
}());
$scope.refreshWebrtcSettings = function() { $scope.refreshWebrtcSettings = function() {

Loading…
Cancel
Save