Commit Graph

43 Commits

Author SHA1 Message Date
Tim Abbott 1cfde054ff Initialize new_message_count to 0 by default.
860cf68716 introduced calls to
notifications.redraw_title() on narrow activation.  This introduced a
bug when the Zulip desktop app reloads while narrowed --
new_message_count would still be set to undefined when
narrow.activate() is called as the page (re)loads, and thus we'd call
window.bridge.updateCount(undefined), resulting in a traceback.

We fix this by just initializing it to 0, rather than using the old
default value of undefined.
2016-01-09 15:43:20 -08:00
Liz Sander 860cf68716 Show current narrow in page title.
Fixes issue #157.
2015-12-14 21:21:30 -08:00
Elizabeth Sander 2ba01f4900 Defer permission for notifications until after tutorial.
In the process, remove old mozilla notifications hack since the
notifications_api shim should handle that case correctly.

Fixes #17.
2015-10-26 09:44:15 -07:00
Allie Jones cd1fa6a42e Fix notifications in Firefox by calling the constructor with 'new'. 2015-10-01 09:31:05 -07:00
Waseem Daher 307d367346 Initial support for white-labeling Zulip as "Dropbox Chat" or otherwise.
Known issues:
* No support for whitelabeling in the email
* No whitelabeling for any externally-visible branding

(imported from commit 9eab7b0744e56a87007b8621a8bb18bbb1080256)
2014-07-29 21:46:33 -07:00
Jason Michalski cb153967ec Fix notifications on chrome
Chrome has removed the webkitNotifications API and not only has the w3c
web notifications API. This adds a shim when webkitNotifications is
missing but Notification is present.

(imported from commit e21c476f9ae6570c297c88bd6ff90a97818688e6)
2014-05-28 20:11:16 -07:00
Steve Howell 7fce920522 Move favicon-related functions to favicon.js
util.reset_favicon -> favicon.reset
util.set_favicon -> favicon.set

(imported from commit 250848ec5dc7ac58649197c8cc4b7b4e7b19f25c)
2014-03-14 20:48:55 -04:00
Steve Howell e993b8fc40 Replace "/me" with sender's name in notifications.
This fixes #2358.

(imported from commit 579f217687bd2af80ab6919a72435336ab456410)
2014-03-11 13:06:18 -04:00
Jessica McKellar df7f85d3c3 Don't show in-app notifications if stream desktop notifications are disabled.
(imported from commit efa29afaa40b65557149ea8a2cbc60e1bc44bee2)
2014-03-03 17:22:17 -05:00
Jessica McKellar 66edc784f9 Generate and handle client-side events for global notification changes.
(imported from commit 40056e8ae284da27db0215e7d8320c8f7db2c52b)
2014-03-03 16:08:33 -05:00
Jessica McKellar b07f4efc13 Use new stream-level notification settings when notifying.
(imported from commit 8db2cf5a44ddc8a9ce285c5f0e50e049fea06573)
2014-03-03 16:08:31 -05:00
acrefoot 7ebb3ec05d Fix message for PM outside current narrow
This resolve Trac #2270

(imported from commit ab814e8e50f48a53054c28f07579f65040edceb8)
2014-02-27 20:25:29 -05:00
Leo Franchi d961829355 Tell the desktop app the source of a desktop notification
(imported from commit ed697d50e35589a61746ad66bff5ae50becead77)
2014-02-05 12:02:27 -05:00
Steve Howell 8266ac3cf9 Extract notifications.redraw_title().
This sets us up to redraw the window title without having to
pass in the unread count, which will be useful for realm name
changes.  The redraw_title() function is only responsible for
rendering stuff, whereas update_title_count() handles
the details of caching the count.

(imported from commit 67cfb7a273e2a61720ce2bd8d91d73fe1089c813)
2014-02-04 11:33:18 -05:00
Tim Abbott 004fd0eab8 Move unread-related functions from zulip.js to unread.js.
(imported from commit efc0dd84c2cd30b0203b906af6991475d8a63985)
2014-01-31 14:59:03 -05:00
Leo Franchi 91fb4f6b8c Fix clicking on link to message when sending outside this narrow
(imported from commit 6eeeb3b4c06021be21f48c8c5f2869904cd13b09)
2014-01-28 16:03:11 -05:00
Steve Howell 813fc05b5b Do notifications after message edits.
If a message edit causes a message to become notifiable, we send
a notification to the user, but only if they haven't had any previous
notifications for this message.

(imported from commit cee854de2d42c31a7352a350f79490caf94b613c)
2014-01-10 21:39:03 -05:00
Waseem Daher 96ebf7e147 Change wording for message-not-visible notification in search.
This is basically morally part of c92aaee484c28fcae7809a3bdfc647e86ae27013

(imported from commit 0e64f4e636dc6dbfbf4ef93cf497e47bbd26a03a)
2014-01-06 11:11:28 -05:00
Steve Howell 055cc2d984 Change wording for message-not-visible notifications.
(imported from commit c92aaee484c28fcae7809a3bdfc647e86ae27013)
2014-01-02 14:27:49 -05:00
acrefoot d218ce3306 always show notifications when in auto-scroll forever mode
(imported from commit c2b79312774979281bb65d3871debc21a1a22e72)
2013-12-19 17:38:19 -05:00
Kevin Mehall a59760883d Fix JS error when sending a PM outside your current narrow
This is the "Tried to call a Dict method with an undefined key" error
because it tried to look up stream information for `undefined`.

(imported from commit 0187f185f3e424a0c9ea940d9b32f07376ac8952)
2013-12-10 15:35:11 -05:00
acrefoot 8e0cf79f91 better out-of-view message for replies to muted streams
(imported from commit 8aa9b69428a7dc30d726f8e57c353e1c0e652c53)
2013-12-09 20:09:11 -05:00
acrefoot 068fac2d7e Change out-of-view message for replies to muted topics
(imported from commit 79a42cbaac1294c03789c467c6774ff7bf990e74)
2013-12-09 20:09:11 -05:00
acrefoot 3542b63bb7 show notification for @-mentions in muted topics and muted streams
(imported from commit 7c6303a083f1f7d364920462e42360b71d7159b5)
2013-12-09 20:09:11 -05:00
Kevin Mehall 8bf8798e0c Remove problematic unused variable in "outside narrow" notification.
`$(message.content)` breaks on /me messages because they are not
wrapped in `<p>` so the message content is interpreted as a selector.

The message text is no longer used, so this line  can simply be removed.

(imported from commit ee8d48c1f5fc489cc577cc466f629891ea65d55f)
2013-11-25 13:41:37 -05:00
Waseem Daher 5403a2d9b0 Experiment: Clicking desktop notification jumps you to the message in a narrow.
This seems to only work in Chrome and Safari.
Firefox (at least my version) simply doesn't fire an onclick
event, and our desktop app has its own native code that decides
what to do when a notification is clicked.

(imported from commit 30bacec4726b9e6c022dd2c74f83d37747260dba)
2013-11-22 16:33:41 -05:00
Jessica McKellar 7b7dd7d8ca Give notifying on sends not in view to everyone.
(imported from commit cae30d82e3647c3b710c568e47cc217457d3ab03)
2013-11-19 17:19:27 -05:00
Jessica McKellar 657e1f1f9a Don't show the out of view banner for messages further down.
This makes the notification slightly more conservative as we do our
initial roll out. In particular, it avoids cases like being notified
when you are almost at the bottom of your feed for a message in your
narrow.

(imported from commit 9c834b1c344d8c429de92fb3512f32494fc02379)
2013-11-19 17:17:33 -05:00
acrefoot e2c388c49c Attempt 2: Notifications in the composebox
This moves the notify-not-in-view notifications into the composebox area.
It also tries to be a bit smarter about what action it links and what it displays.

(imported from commit 1c79bd0d9ef972059a006b17501a09b72e961ee3)
2013-11-18 16:09:34 -05:00
Tim Abbott 8853d86b17 Disable notifying on sending outside view for now.
It's somewhat buggy, and has thus been annoying our internal users, so
better to disable it until we can fix the bugs.

(imported from commit f981791d32d321b0cfe06b4a337e26ab48832bb3)
2013-11-04 18:32:34 -05:00
acrefoot 83d2fcaf58 above-composebox notifications only on zulip.com realm
(imported from commit edc86511adb168e648652ecea54f7ee4f16b47eb)
2013-11-01 12:34:39 -04:00
acrefoot 434b7ac120 Give Feedback in non-obvious cases for sent messages
Displays a notification above the composebox in cases where the message
is not visible (further down), or where it's outside the current narrow or search.

It also offers a link to the appropriate narrow when it makes sense, and offers
timetravel when appropriate. There is currently a bug with timetravel (and you can
see this when using the popover menu) that makes "narrow to messages around this time"
not work for muted messages.

This resolves Trac #1518.

(imported from commit 391ca0b9c07d91496f6585a4fd8e15723d1170e2)
2013-11-01 12:34:39 -04:00
Tim Abbott c5b0076ecf Rename humbug => zulip in audio files.
(imported from commit f297f1f9c8683d4e02e7a0c4ecf2182fc79b89f9)
2013-10-31 15:29:48 -04:00
Jessica McKellar 06566b3776 Don't receive notifications for messages on muted topics.
This doesn't address the more complicated case of someone @-mentioning
you on a muted topic, which consensus is you do want to get
information for, but we need to develop some infrastructure to present
that case to users clearly.

(imported from commit a4bc1e89c108fa8ba6eccc0a198eabf2231326ab)
2013-10-18 14:38:31 -04:00
Jessica McKellar efda426b86 notifications: split message_is_notifiable into multiple ifs for clarity.
(imported from commit 33d1e2135a87192cc4d964db534b31ae9335595a)
2013-10-18 14:38:31 -04:00
Jessica McKellar a9c7f3a387 [manual] Use the name instead of the domain for the user-visible realm identifier.
Do not push this commit to prod until the historical realm names have
been populated.

(imported from commit a58191d181d2fb2b8b5e9793ea57707b36812cfc)
2013-10-17 13:47:51 -04:00
Steve Howell e83c026a27 Set focus-related flags correctly after a server reload
(imported from commit 408469c0da0cfa5513e6838329816cd88665981f)
2013-09-16 12:29:34 -04:00
Leo Franchi 897dd87b94 Add a span around alert words to mark them visually
(imported from commit 9b8fbbd957086f1eeaa3409e5830aa6d7974fbe8)
2013-09-05 10:18:40 -04:00
Jeff Arnold 6a9b441853 Clear a desktop notification once its source message has been read.
Addresses Trac #1698.

(imported from commit 859fc7d436904f21427d15f6363c4e0ca859e02a)
2013-08-29 17:16:11 -04:00
Zev Benjamin 72927e9d77 Fix unread count badge on OS X desktop app
For web pages, the initial favicon is the same as the favicon we
set for no unread messages and the initial page title is the same
as the page title we set for no unread messages.  However, for the
OS X app, the dock icon does not get its badge updated on initial
page load.  If the badge icon was wrong right before a reload and
we actually have no unread messages then we will never execute
bridge.updateCount() until the unread count changes.  Therefore,
we now ensure that bridge.updateCount is always run at least once
to synchronize it with the page title.

(imported from commit 5d1269c62c1c3190aea96ef6f96c46acdb9fdf9c)
2013-08-14 17:30:16 -04:00
Tim Abbott 5a320db3c1 Add curly braces for all javascript if statements lacking them.
(imported from commit 32c7643d1a6ecdfaf634424d217938c8a368dade)
2013-08-01 11:47:54 -04:00
Scott Feeney 8703134a23 Replace $.each with _.each
In a few cases the $.each was doing something imperatively that was
terser and easier to understand by using a different Underscore method,
so a few of these I rewrote.

Some code was using the fact that jQuery sets `this` in the callback to
be the item; I rewrote those to use an explicit parameter.

Some code was using $(some selector).each(callback). I converted these
to _.each($(some selector), callback).

One function, ui.process_condensing, was written to be a jQuery $.each
callback despite being in a totally different module from code using it.
I noticed this and updated the function's args.

(imported from commit bf5922a35f257c168cc09ec1d077415d6ef19a03)
2013-07-30 12:12:58 -04:00
Tim Abbott 3bba0cc927 Move zephyr/static to just static.
It's not really a part of the server (aka the rest of zephyr/).

(imported from commit 27f6b6b064938ad927075a68d873e4b68710d279)
2013-07-29 12:11:26 -04:00