Commit 232335f6d7bfbdc96a4797549da855e78363c231

Authored by OpenWapp Developer

Merge branch 'fix_notifications_11' of /home/git/repositories/openwapp/openwapp

Showing 3 changed files

app/scripts/utils/notifications.js View file @ 232335f
1 1 define([
2 2 'backbone',
3   - 'global'
4   -], function (Backbone, global) {
  3 + 'global',
  4 + 'utils/platform'
  5 +], function (Backbone, global, platform) {
5 6 'use strict';
6 7  
7 8 var Notification = Backbone.Model.extend({
... ... @@ -110,6 +111,12 @@
110 111 _this._app.launch();
111 112 // TODO: to open the app in the conversation
112 113 // window.location.hash = '#conversation/' + phone;
  114 +
  115 + // Firefox OS 1.1 does not send the onclose event along with the
  116 + // onclick, so we must rely on onclick only for 1.1
  117 + if (platform.isFFOS11()) {
  118 + _this._unattendedNotifications--;
  119 + }
113 120 };
114 121  
115 122 notification.onclose = function () {
app/scripts/utils/platform.js View file @ 232335f
  1 +define([], function () {
  2 +  'use strict';
  3 +
  4 + return {
  5 + isFFOS11: function () {
  6 + return (typeof navigator.mozTCPSocket.listen) !== 'function';
  7 + }
  8 + };
  9 +});
app/scripts/views/multimedia-message.js View file @ 232335f
... ... @@ -6,8 +6,9 @@
6 6 'global',
7 7 'models/message',
8 8 'templates',
9   - 'utils/mimetype'
10   -], function (Backbone, $, global, Message, templates, Mimetype) {
  9 + 'utils/mimetype',
  10 + 'utils/platform'
  11 +], function (Backbone, $, global, Message, templates, Mimetype, platform) {
11 12 'use strict';
12 13  
13 14 return Backbone.View.extend({
... ... @@ -76,10 +77,6 @@
76 77 return false;
77 78 },
78 79  
79   - isFFOX11: function () {
80   - return (typeof navigator.mozTCPSocket.listen) !== 'function';
81   - },
82   -
83 80 isAAC: function () {
84 81 return this.model.get('contents').uri.match(/.aac$/);
85 82 },
... ... @@ -88,7 +85,7 @@
88 85 var _this = this;
89 86  
90 87 // XXX: Delegate on browser to see media on Firefox 1.1
91   - if (!_this.isAAC() && _this.isFFOX11()) {
  88 + if (!_this.isAAC() && platform.isFFOS11()) {
92 89 new MozActivity({
93 90 name: 'view',
94 91 data: { type: 'url', url: this.model.get('contents').uri }