Commit graph

1700 commits

Author SHA1 Message Date
lilia
4d4dd3341f Add isBlocking/isNonBlockingApprovalRequired
These analyse the identity key record and user preferences to determine whether
a key requires approval for sending.

// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
22e907a8d4 Add getProfile to MessageSender
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
0c5a69cce4 Add support for getProfile to TextSecureServer
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
9f4a657e8a Add database migration
// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
3afe378063 Remove legacy property from OutgoingMessage 2017-07-05 18:05:56 -07:00
lilia
d47ced1199 Don't recompute outgoing message padding
We can use the same padded plaintext across multiple numbers or attempts rather
than re-creating it every time we encrypt to a particular number.

// FREEBIE
2017-07-05 18:05:56 -07:00
lilia
30201969be Inline some functions in OutgoingMessage
Since we no longer have legacy messages to send, we can simplify things a bit
here.

// FREEBIE
2017-07-05 18:05:56 -07:00
lilia
e8548879db Stop sending legacy DataMessages 2017-06-20 17:57:27 -07:00
Scott Nonnenberg
3fbd1ab618 Use error.stack instead of error for console log
Chrome/V8 give you the error name, message and callstack at that
property, where toString() gives you [object NavigatorUserMediaError]

FREEBIE
2017-06-20 16:57:11 -07:00
Scott Nonnenberg
98f88607a0 Remove recorder UI when we fail to 'getUserMedia'
FREEBIE
2017-06-20 16:57:11 -07:00
Scott Nonnenberg
24174312b9 Fix: Show attachment views; they trigger update syncrhonously
FREEBIE
2017-06-16 10:52:57 -07:00
Scott Nonnenberg
2b5e56f6be Use setElement to ensure that re-parented views listen for events
FREEBIE
2017-06-15 16:28:15 -07:00
Scott Nonnenberg
40651f44ab
MessageView.appendAttachmentView: Remove from proper parent
FREEBIE
2017-06-08 19:59:22 -07:00
Scott Nonnenberg
f602ac462f A little cleanup in ConversationView.resetLastSeenIndicator
FREEBIE
2017-06-08 17:04:07 -07:00
Ikarulus
1021f835fe changes due to feedback 2017-06-07 15:53:14 -07:00
Ikarulus
068cf5092c fix typo 2017-06-07 15:53:14 -07:00
Ikarulus
ec3278ca3a add message length warning for android clients 2017-06-07 15:53:14 -07:00
Scott Nonnenberg
d269751dbc Conversation.markRead: Return a promise so queueJob works
FREEBIE
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
785b117b86 Mark older messages as read when we get out-of-order read receipt
FREEBIE
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
aeefc530d2 Conversation.markRead: Remove checks for unread
We will now always attempt to mark things unread if this method. If the
conversation's unreadCount gets out of date, set to zero, we will still
do it. If we go through the motions, and nothing is newly marked read,
we will still set the unreadCount to zero.
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
6fbdd63e7e Conversation.onReadMessage - queue job, don't send read receipts
We queue the job because we often get a whole lot of read receipts at
once, and their markRead calls could very easily overlap given the async
pull from DB.

We also disable read receipts for any message marked read due to a read
receipt. That's a notification explosion we don't need.

FREEBIE
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
89046484ed Read receipts: Also mark all messages read prior to this one
We mark as read everything older than this message - to clean up old
stuff still marked unread in the database. If the user generally doesn't
read in the desktop app, so the desktop app only gets read receipts, we
can very easily end up with messages never marked as read (our previous
early read receipt handling, read receipts never sent because app was
offline).

FREEBIE
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
f38d8eb4ae Fix: Ensure that attachments are always rendered
Because we only attach AttachmentViews to the DOM when they fire their
'update' event, we were subject to a race condition. If that event fired
after the final Message.render(), then it would be properly attached to
the final DOM node. If it fired early, it would end up missing from
the visible DOM entirely, attached to the old, discarded version of
the message.

This change updates our handling of a second call to loadAttachments().
Instead of bailing out if we've been called before, we attempt to
re-add our child AttachmentViews to the current DOM. But only if the
'update' event has been fired, and if their current parent node is not
what is in the DOM.

FREEBIE
2017-06-07 15:28:30 -07:00
Scott Nonnenberg
da8d49b5ed ConversationView.markRead: Mark all messages read when at bottom
To handle the same 'not quite at the bottom' case that our 30px buffer
gives us for marking messages read, we use the same atBottom() method to
determine whether we should mark everything unread. Saves the effort and
potential missed messages (due to partial pixels, etc.).

FREEBIE
2017-06-07 15:27:27 -07:00
Scott Nonnenberg
6bfeb7ab14 Conversation.sendMessage: Don't set unreadCount to zero
This is no longer guaranteed to be true. If you're scrolled up in a
conversation, you may not have read all messages. Setting the
unreadCount to zero will prevent the user from marking any of their
existing messages as unread until something else happens, like receiving
a read receipt or new message.

FREEBIE
2017-06-07 15:27:27 -07:00
Scott Nonnenberg
bb483474a3 Fix: Show hourglass on incoming disappearing messages once read
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg
9a09e7a16b TimerView: Update only as often as 500ms
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg
5351b60365 TimerView: Remove some unused bits of code
- initialize doesn't need to call update because
  MessageView.renderExpiring() calls it immediately
- we don't need the className because that's already present on
  the el it attaches to, part of the MessageView's template.

FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg
fb7e7cf34c TimerView: don't continue to update after expiration
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg
0c2c36c11a loadMoreMessages: Fix broken reference to this.view.outerHeight
:0/

FREEBIE
2017-06-02 12:08:06 -07:00
Ikarulus
ab5489baa0 fixed #1163, dark theme flaw 2017-06-01 16:45:17 -07:00
Scott Nonnenberg
ec22445f75 Bulletproofing of markRead and findNewestVisibleUnread
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
1775e97bcd Add comment and fine-tune last-seen indicator when not focused
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
672a517b73 Preserve lastSeenIndicator location when not focused
Also, a couple name changes of ConversationView methods to better
reflect what they do. update -> reset, since the method is destructive.

FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
944ae296eb Prevent 'mark read on scroll' during fetches
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
b60b20bde4 Mark messages read only when visible, on receipt, focus, scroll
- Only mark messages read when scrolling if in focus and visible
- Remove last seen indicator when scrolling to the bottom with scroll
  down button
- Update last seen indicator when we don't already have one and we're
  scrolled up.

FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
9a0a87ab40 Last seen indicator: dismissed only on open and send
It can be moved if you're not scrolled to the bottom of of the window
or the window doesn't have focus when a new message comes in. Other than
that, it marches up the window until you close and reopen the
conversation, or send a message.

Note that we do NOT mark messages as read if they come in when you are
scrolled up. But we do mark the entire conversation as read if you
switch away from the app and back.

FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
eb1a4b3ac6 loadAttachments: Handle the zero -> some attachments case
FREEBIE
2017-06-01 15:38:26 -07:00
Scott Nonnenberg
0e1b534d3c Make MessageView.render() idempotent
Re-renders happen when we re-fetch messages from the database, and our
previous technique for loading attachments resulted in a new attachment
view added for every call to render()

This change ensures that a second call to render() does not add any more
attachment views.

FREEBIE
2017-06-01 15:38:26 -07:00
Scott Nonnenberg
25ebcc3131 Fix broken reference to i18n string 'mediaMessage'
FREEBIE
2017-06-01 15:38:26 -07:00
Scott Nonnenberg
0b6d5de753 Update the scroll position when 'fetch more messages' is complete
FREEBIE
2017-06-01 15:19:08 -07:00
lilia
3dbb21c53c Fix being re-added to a group you previously left
Negate the flag marking the group as left. Fixes #1207.

// FREEBIE
2017-05-30 10:51:07 -07:00
Scott Nonnenberg
13a91eece8 MessageListView.measureScrollPosition: reuse variables 2017-05-30 10:44:00 -07:00
Scott Nonnenberg
c5530b7235 Increase wiggle room to 30 px, which should ensure text cut off
FREEBIE
2017-05-30 10:44:00 -07:00
Scott Nonnenberg
84397a2ef4 20px at bottom of conversation considered 'at the bottom'
So users who are 'close enough' at the bottom of the conversation won't
get marooned in history.

FREEBIE
2017-05-30 10:44:00 -07:00
Scott Nonnenberg
09791ab7d9 Make last seen indicator more stable, with less forced removal
FREEBIE
2017-05-26 17:26:35 -07:00
Scott Nonnenberg
c3dc9732ef Fix: Don't scroll to last seen indicator on focus
FREEBIE
2017-05-26 17:26:35 -07:00
Scott Nonnenberg
10c2874d19 Fix race condition: Pull from database after add to conversation
Also add some console logs to help us determine whether this ever
happens to people in the wild.

FREEBIE
2017-05-26 16:02:14 -07:00
Scott Nonnenberg
9de384f3b8 Reset last seen indicator timing on focus of window
FREEBIE
2017-05-25 16:41:21 -07:00
Scott Nonnenberg
01918049b4 Keep last seen indicator around for five seconds
Helps calm the user experience a little more, makes it easier to
understand what's happening when messages are coming in quickly.

FREEBIE
2017-05-25 16:41:21 -07:00