Commit Graph

77 Commits (30b7bf23dbfabf8a087d70f4d769b8c23d2d75cd)

Author SHA1 Message Date
lilia cce1fe5c4b Simplify openConversation
Now that the InboxView is initialized in the background page context, we
can manipulate it more directly, without going through a global function
on the foreground window.

// FREEBIE
8 years ago
lilia 72dd93aa02 Clear window attention if all messages are marked read
Fixes #758

// FREEBIE
9 years ago
lilia 9ea9a8160b Add logging when opening inbox
// FREEBIE
9 years ago
lilia d121effe3b Add logging for clearing taskbar attention
// FREEBIE
9 years ago
lilia 1be45f3775 Derive global unread count from individual counts
// FREEBIE
9 years ago
lilia 3a494bf2a3 Log when we draw attention to the window
Hopefully help debug spurious cries for window attention.

// FREEBIE
9 years ago
lilia a23e862e62 Clear dock/taskbar attention on window focus
Fixes #440

// FREEBIE
10 years ago
ody 86edcc06c2 Add updating of window title on launch
The window title show the number of global unread messages when the
inbox window launches.
10 years ago
ody 156c7c3b3d Add unread count in window title
The window title now shows the global number of unread messages as
"Signal (1)". This way the user can see the number of unread messages
in the task bar and when alt-tabbing.

Resolves: #384
10 years ago
lilia f0dcf44b9f Use onClosed instead of onSuspend
Renames extension.windows.beforeUnload to onSuspend, to match the
underlying chrome api call. onClosed fires when the frontend app window
is closed, while onSuspend fires when the background page is closed or
refreshed (which amounts to an app restart).

Frontend views are initialized iff the inbox window is opened, and so
should always be listening to onClosed in order to know when they are no
longer needed.

// FREEBIE
10 years ago
lilia 9fcd423e54 Clean up references to appWindow
Don't resummon the window when you have a reference to it already.

// FREEBIE
10 years ago
lilia a569e34b33 Refactor new message notification and frontend updates
Create a cleaner seperation between generating notifications
and updating frontend conversation views. The former is now
handled by `conversation.notify` while the latter is achieved
by triggering an event on the conversation model, which will
only be acted on if there are any views listening for it.

Additionally, instead of re-fetching the entire message history,
which is overkill, just add or update the new/modified message.
This will help speed up the newmessage event handler and also
help avoid unnecessary re-rendering when resolving key conflicts.

// FREEBIE
10 years ago
lilia 4e2723a751 Create notifications if window is not focused
Track focus using focus and blur events.

// FREEBIE
10 years ago
lilia 2f8d973366 Restore native window chrome
// FREEBIE
10 years ago
lilia b1d3829651 Update minimal window dimensions
Some day we'll probably lower these minimums but first we'd need a more
responsive design.

Fixes #310

// FREEBIE
10 years ago
lilia b617240338 Stop calling updateInbox all the time
Now that the inbox collection keeps itself in sync, we don't have the
data duplication that was forcing us to reload constantly.

// FREEBIE
10 years ago
lilia 0017f196ef Move ConversationController to its own file
Encapsulate the global conversation cache collection against accidental
access, avoiding the data-clobbering bug fixed in previous commit.

Also move some one-off program initialization code from panel controller
to background.js

// FREEBIE
10 years ago
lilia 8f28c3af68 Fix disappearing contact info
This errant reference to the global cache of conversations was causing
some contacts to get clobbered.

// FREEBIE
10 years ago
lilia 15a366dbf0 Opening a conversation should focus the window
Previously, this function might open the conversation but not show the
window, if it exists but wasn't on top.

// FREEBIE
10 years ago
lilia a57451d00b Show notifications if the window is minimized
// FREEBIE
10 years ago
lilia 8b27c99f2b Fix exception while creating a conversation
When confirming the creation of a one on one conversation with a new
contact, the first click would do nothing but the second click would
work. Now the first click works.

Fix by only reject new conversation creation if not saved.

// FREEBIE
10 years ago
lilia f8745e1e5b Remove inactive models from inbox collection
Fixes auto archive when deleting all messages, and auto unarchive when
sending a new message. Previously, the convo would not reappear in the
inbox after deleting all messages.

// FREEBIE
10 years ago
lilia d89e3ccdc4 Don't fetch messages from the background
Only fetch them from a frontend view. If the conversation is not open,
we don't need to load the messages, and if we do load them, they will
render before we've done the initial contact info loading (as
implemented in 74e96ce).

Fixes #344

// FREEBIE
10 years ago
lilia edbf2371bf Don't reset inboxWindowId
// FREEBIE
10 years ago
lilia e8edbe53bc Improve notification behavior
Only allow one notification at a time. Use a basic notification for
normal messages, and image notification for image messages, and a list
notification when there are multiple unread messages.

// FREEBIE
10 years ago
lilia 0ebdf08ceb Render identicons in notifications
Render an svg, then canvas, then data url.

Fixes #325

// FREEBIE
10 years ago
lilia 756875f235 Refactor inbox collection listeners
Create a new collection type for the inbox which listens to events on
the main conversation cache. Also don't reload conversation info from
the database as often or when unnecessary.

Fixes #345

// FREEBIE
10 years ago
lilia 0509bb0f5d Remove global updateInbox, used scoped version
// FREEBIE
10 years ago
lilia 949cb8d8e3 Use generic Backbone collection for inbox
There's no need to use a custom collection type here since we don't use
any of the ConversationCollection methods. This helps prevent the
introduction of duplicate models for the same chat.

// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
lilia 98aed2975c Fix conversations opening from the background
From a notification, for example, we were opening the inbox but not the
conversation.

// FREEBIE
10 years ago
lilia 3e5946a12b Move worker initialization to background.js
Not sure why I put it in panel controller. Probably an oversight.

// FREEBIE
10 years ago
lilia 5b430fa8aa Make sure newly active conversations are added to the inbox 10 years ago
lilia e8b4bd708e Fix lint warnings 10 years ago
lilia e3c56a0c03 Refactor and remove old window mgmt code/globals 10 years ago
lilia 3bc64cbed5 Remove unused function 10 years ago
lilia 21aaf0fab5 Clean up notification and unread indicator behavior 10 years ago
lilia baa55c9018 Refactor for less model duplication 10 years ago
lilia 39d13d5e45 Quiet notifications if the window is open
Draw attention to the window instead.

// FREEBIE
10 years ago
lilia 0b98043c1c Add a worker
Offload all the asm.js code to a second thread. This is usually the
source of intermittent frontend freezes when running single-threaded.
10 years ago
lilia d6a4e6e496 Restore two column layout
Establishes basic functionality for viewing conversations in two column
mode, including message area and message list resizing, and maintaining
scroll position.

Various subviews need to be retooled but are more or less still
functional, i.e., new message, message detail, key verification, etc...
10 years ago
lilia fdad87b6a0 Add minimum window dimensions
Fixes #310

// FREEBIE
10 years ago
lilia 9dfff879b6 Remove usage of extension.trigger
This trigger function uses chrome's runtime message passing api, which
traverses between different windows in our runtime, but we only trigger
the updateInbox event from the backgroud page, so we don't need to use
that api, which requires some extra cpu/memory overhead.

// FREEBIE
10 years ago
lilia 9f021a9d7f Update notification code to new avatar format 10 years ago
adambar 52857f09ea Fix for conversation & inbox windows closing callbacks never called.
As discussed in similar issue there: https://github.com/GoogleChrome/chromedeveditor/issues/1023 - it is not possible to add onClosed event listener on an 'abstract' current window property, it needs to be set on the particular window instance instead.

Before that change, the clean up function was never actually called, because the listener was never properly attached. That was probably the reason of existence for "panel isn't actually open ... and so we try again." code that was executed if the previous window wasn't cleaned up properly (so actually every time). This code is no longer needed, I guess, as the windows are now cleaned up properly.
10 years ago
lilia 405e67c758 Merge inbox and panel controllers
These collections should always be operating with the same model
instances, so let the inbox reset it self from the same in-memory
cache of conversation models used by the conversation windows.
10 years ago
lilia 585c82aee8 Fix the build 10 years ago
lilia 3eafefe18e Don't display notifications for open windows.
Just update and draw attention to them.

Fixes #238

// FREEBIE
10 years ago
lilia fa3e1ee94f Window ids should be strings
A warning is issued when a non-string window id was passed to
extension.windows.focus.
10 years ago
lilia 39d11d8eb3 Apply custom chrome to conversation windows 10 years ago