Commit Graph

549 Commits (84237cae6f12b55cd317cf80fb87a37ca88dc75e)

Author SHA1 Message Date
lilia 9baafddb14 Add license to file input view 10 years ago
lilia d470b0eb53 Less jquery, more templating in conversation view
`if (foo) then jquery-dom-insert...` is a poor pattern to follow.
Instead, let mustache do the work.
10 years ago
Emily Chao e74cba8a92 Restyled country dropdown
Added jquery plugin that allows for flags and country codes to be
displayed in a user-friendly way, on top of the existing phone view
10 years ago
Emily Chao 5d3020b9ed Refactor phone number input view
Moves validation logic to its own view to be shared on index and options
pages.
10 years ago
lilia 44007ca58f Add rudimentary ui for sending a group update 10 years ago
Matt Corallo 334550b779 Regenerate components/libts 10 years ago
Matt Corallo 5785f4033c Compile curve25519/webcrypto into libtextsecure.js 10 years ago
Matt Corallo 07899557dc Give libtextsecure its own components (with way fewer deps) 10 years ago
Matt Corallo 8ad1a38b5b Move js files around for libtextsecure split 10 years ago
Matt Corallo 13d403b334 Switch to isNumberSane in group storage 10 years ago
Matt Corallo 17782660e2 Add isNumberSane to textsecure.utils for basic validation 10 years ago
Matt Corallo 6b933455e3 Merge pull request #108 from TheBlueMatt/refreshgroup
Replace all the refreshGroups stuff
10 years ago
Matt Corallo eac506557f Replace refreshGroups with singular refreshGroup on send 10 years ago
Matt Corallo 0b19e5b9c3 Replace numer->group with group->number->registrationId tracking 10 years ago
Matt Corallo 67bb400b87 Revert "Don't refreshGroups in tryMessageAgain", making a better one
This reverts commit f9e68be45b.

Conflicts:
	js/sendmessage.js
10 years ago
lilia d119bdff01 restore default avatars 10 years ago
Matt Corallo 6124084807 Bring padding calculation in-line with android 10 years ago
lilia d8efc4d216 Handle incoming group avatars on group creation 10 years ago
lilia 3d6c251fd1 Group avatars 10 years ago
lilia d52db8fe6f Render group updates
Not pretty, but it works. Also allows for later localization.
Copy/behavior is borrowed from the Android client.

Closes #104
Fixes #65
10 years ago
lilia 4e6faf4e27 Always listen for (re-)registration events
If we clear local storage and re-register in a foreground page, the
background page needs to re-init its websocket with the new account
credentials.
10 years ago
Matt Corallo 7ebf0f5085 Remove last \t in protocol.js 10 years ago
Matt Corallo 406be10f53 s/\t/ /g in sendmessage.js 10 years ago
lilia fca67d7b0e Simplify pushMessageContent handler slightly
New private conversations have their type set in onMessageReceived. New
group conversations should be handled the same way as normal group
updates. It was pointed out we should never have to handle a group
message without a preceding group update, as those would be rejected by
textsecure.processDecrypted. An exception would be if you delete the
group from indexedDB but not localStorage, but that's not a mode we
should be supporting.

Also in this change I switched to instantiating a new conversation
object on every call to handlePushMessageContent. Originally, I thought
to use the local conversation list as a cache, but it's a bit simpler to
re-read from the database every time for now. Later on we should revisit
and optimize for fewer read/writes per incoming message.
10 years ago
lilia 0ea176dfa0 Don't require a conversation name
Just display a sensible default in the frontend if it's unset.
For private conversations this should be the phone number, for
groups, the list of numbers.
10 years ago
lilia 0292c12712 Catch and save Bad Mac errors on the incoming message model 10 years ago
lilia 40b54185f3 If we happen to get a group message with no update, use a blank name 10 years ago
lilia f23403f82b Fix arguments to sendMessageProto in tryMessageAgain
As ov ccc98d2 sendMessageProto takes a timestamp for the first argument,
in service of app-level delivery receipts.
10 years ago
lilia f9e68be45b Don't refreshGroups in tryMessageAgain
This was intended to sync the group state of a recently re-installed
client, but is prone to overkill when we have a lot of old stale groups
around. Also this implementation incurs some rate limit errors from the
server.
10 years ago
Dave Sescleifer 2462aba24b Fixed timestamps and added last message to the gutter 10 years ago
Dave Sescleifer 441962abc6 Fixed date format 10 years ago
lilia 1175f2ae3c Scratch that, reverse it. 10 years ago
lilia 8ed73d0ce5 Normalize send-path error handling
Receive and handle an array of errors in both the group and individual
cases.
10 years ago
lilia 80993753de Fix bug overwriting existing conversation names
On incoming messages for pre-existing conversations, don't update any
attributes unless it's a group update message.
10 years ago
lilia 30bca85f5a Fix undefined proto.source 10 years ago
lilia ccc98d2f3d Fixup delivery receipts
Uses app-level timestamps for outgoing messages.
Adds timestamp property to the outgoing jsonData.
Triggers a runtime event to notify frontend on delivery receipts.
Renders delivered messages with a 'delivered' class.
10 years ago
lilia 348b5a53b1 Fixup OutgoingIdentityKeyError handling 10 years ago
lilia 3795ea5070 Fix message view using the wrong attribute 10 years ago
lilia cfd4ccc803 Move index querying logic to /models 10 years ago
lilia 6cbde7894a Delivery receipts 10 years ago
lilia 006653ed8e DB/Index Redux
This change removes the timestamp field from messages and conversations
in favor of multiple semantically named timestamp fields: sent_at,
received_at on messages; active_at on conversations. This requires/lets
us rethink and improve our indexing scheme thusly:

The inbox index on conversations will order entries by the
conversation.active_at property, which should only appear on
conversations destined for the inbox.

The receipt index will use the message.sent_at property, for effecient
lookup of outgoing messages by timestamp, for use in processing delivery
receipts.

The group index on conversation.members is multi-entry, meaning that
looking up any phone number in this index will efficiently yield all
groups the number belongs to.

The conversation index lets us scan messages in a single conversation,
in the order they were received (or the reverse order). It is a compound
index on [conversationId, received_at].
10 years ago
lilia 9c736df7d0 Handle incoming identity key changes
This ended up turning into a rewrite/refactor of the background page.
For best results, view this diff with `-w` to ignore whitespace. In
order to support retrying message decryption, possibly at a much later
time than the message is received, we now implement the following:

Each message is saved before it is decrypted. This generates a unique
message_id which is later used to update the database entry with the
message contents, or with any errors generated during processing.

When an IncomingIdentityKeyError occurs, we catch it and save it on the
model, then update the front end as usual. When the user clicks to
accept the new key, the error is replayed, which causes the message to
be decrypted and then passed to the background page for normal
processing.
10 years ago
lilia 5762e59c41 DRY up registration event callbacks
This was just a special case of the extension.on/trigger interface.
10 years ago
lilia e68720f07f Frontend support for ReplayableErrors
Eventually we'll store errors on the message model, and this change will
let us render and process them.
10 years ago
lilia 4a401f07f3 Rewrite ReplayableErrors
ReplayableErrors make it easy for the frontend to handle identity key
errors by wrapping the necessary steps into one convenient little
replay() callback function.

The frontend remains agnostic to what those steps are. It just calls
replay() once the user has acknowledged the key change.

The protocol layer is responsible for registering the callbacks needed
by the IncomingIdentityKeyError and OutgoingIdentityKeyError.
10 years ago
lilia 14c53ff710 Support for lower-level queries on indexedDB
superfeedr has done a nice job with this backbone -> indexedDB adapter,
but their query interface is somewhat limited. This commit adds an
alternate interface that lets us specify the index and cursor bounds we
want. This interface requires deeper knowledge of indexedDB indices, but
is more powerful overall.
10 years ago
lilia 8c93101989 Don't store conversationType on messages
This was used to conditionally render messages in the group style, but
it's actually unnecessary. We can render the same markup in both cases
and change the appearance with css.
10 years ago
lilia 2209407d5e Keepalive endpoint 11 years ago
lilia 4f97f8c1e4 Incoming request bodies are no longer base64
Since the socket is not a text-based transport, there's no need to
base64-encode the IncomingPushMessageSignal.
11 years ago
lilia 2ba88bd13a Shorten keep alive interval. Closes #97 11 years ago
lilia 8257fa7478 Add support for deleting a conversation
Note that the conversation record is not actually destroyed,
merely marked inactive, preserving the contact name, photo,
etc...
11 years ago
lilia 7b23e24b71 Add stringview license info and script tags
Closes #94
11 years ago
Daniel Reichert db5683a69d Move Base64 functions to their own file
Remove Base64 string functions from helpers.js

Rename Base64 string functions

Removed unused functions from stringview.js
11 years ago
lilia ee0d7edc0b WebSocket-Resources / websocket refactor
This commit provides the javascript complement to
[WebSocket-Resources](https://github.com/WhisperSystems/WebSocket-Resources),
allowing us to use a bi-directional request-response framework over
websockets.

See websocket-resources.js and websocket-resources_test.js
for usage details.

Along the way I also factored the websocket keepalive and reconnect
logic into its own file/wrapper object.
11 years ago
lilia ccbe837ca2 Rebind events when opening a previously opened conversation 11 years ago
lilia 99a2685f93 Store attachments as binary blobs
Move base64 encoding of attachments to an AttachmentView. This makes
image rendering an asynchronous task so we fire an update event to
indicate to the parent MessageListView that its content has changed
height and it is time to scroll down.
11 years ago
lilia bf22da209f Fix tests 11 years ago
lilia d1c5b6da7a Get rid of Layout global
Instead, trigger and listen for events on the conversation collection
object.
11 years ago
lilia a835887459 Fix scroll when re-opening a conversation 11 years ago
lilia fd3a72d435 Destroy all globals
Well, not *all* globals..
11 years ago
lilia c0681beca7 Consolidate message callbacks
Register the runtime callback at the top level view rather than having
each conversation view register independently.
Also refactors Layout into InboxView.
11 years ago
lilia 470346c9c4 Save incoming messages and pass to frontend asynchronously
After a message is saved asynchronsly, fire an event and pass the
message attributes to frontend listeners via the chrome-runtime API.

This behavior is similar to the 'storage' event fired by localStorage.
11 years ago
lilia ced295a630 Move message and conversation storage to IndexedDB
Getting up and running with IndexedDB was pretty easy, thanks to
backbone. The tricky part was making reads and writes asynchronous.
In that process I did some refactoring on Whisper.Threads, which
has been renamed Conversations for consistency with the view names.

This change also adds the unlimitedStorage permission.
11 years ago
lilia 7f04439b37 New websocket protocol 11 years ago
lilia 9364cee578 Misc cleanup threads 11 years ago
lilia b9859ad9d4 Add some license headers 11 years ago
lilia 735737f0bc Merge Whisper.Messages into Whisper Threads
Eliminates the global Whisper.Messages object and consolidates shared
send/receive logic in Whisper.Threads.

To the latter end, note that the decrypted array buffer on an attachment
pointer is now named data instead of decrypted, in order to match the
format of outgoing attachments presented by
FileReader.readAsArrayBuffers and let us use the same handler to base64
encode them.
11 years ago
lilia 5a0e199fc5 Namespace registration helpers 11 years ago
lilia 28290477f4 Nicer timestamps with momentjs
This dependency may be a little heavy for our current use case, but we can
roll with it for now and find something slimmer if it turns out yagni.

Closes #77
Closes #40
11 years ago
Sumit Bindal d537d6a91f Fixing lint errors
Fixing JSLint Problems
11 years ago
lilia 0956d328da Fixes #71 Autoscroll
Conversation view autoscroll triggers on dom change, not storage change,
ensuring that we don't scroll before the new element is inserted.
11 years ago
lilia 13446e9c17 "Fix dirty hack" (runtime.reload) in chromium.js
Runtime reload is overkill and causes a jarring ux. Instead, send and
receive messages across the runtime. Also, if we need to jump between
the main ui and options pages, simply navigate within the current tab
rather than spawning a new one.
11 years ago
lilia 4119c13ba2 Registration ux tweaks 11 years ago
lilia 18378d8097 Fold nacl-common into components 11 years ago
lilia 1ad898a62e Simplify webcrypto type conversion
Previously we'd get a WordArray and convert to string before converting
to array buffer. Instead, go directly to array buffer.
11 years ago
lilia e190582d9e Build CryptoJS components into webcrypto.js
We only depend on cryptojs for this webcrypto polyfill, so let Grunt
concatenate them into one file.

The reference in the getString helper isn't needed since we use the
built in string converters on CryptoJS's word arrays.
11 years ago
lilia c69c05c15d Remove obsolete argument 11 years ago
lilia 0ff3d438be Update libphonenumber
```
bower install
cd components/libphonenumber-api
./build.sh
grunt
```
Closes #54
11 years ago
lilia 2f58ea5f3a Fixup curve25519 module
Rename methods on the curve25519 interface to be a bit more high level.
Cleanup emscripten wrapper class, wrap long lines and such. Also add a
grunt task alias for building the emscripten compiled curve
implementation.
11 years ago
lilia a1a528ccdd Finish abstracting native client
Firstly, don't initialize textsecure.nativclient unless the browser
supports it. The mimetype-check trick is hewn from nacl-common.js.

Secondly, nativeclient crypto functions will all automatically wait for
the module to load before sending messages, so we needn't register any
onload callbacks outside nativeclient.js. (Previously, if you wanted to
do crypto with native client, you would have to register a call back and
wait for the module to load.) Now that the native client crypto is
encapsulated behind a nice interface, it can handle all that
onload-callback jazz internally: if the module isn't loaded when you
call a nativeclient function, return a promise that waits for the load
callback, and eventually resolves with the result of the requested
command. This removes the need for textsecure.registerOnLoadCallback.

Finally, although native client has its quirks, it's significantly
faster than the alternative (emscripten compiled js), so this commit
also lets the crypto backend use native client opportunistically, if
it's available, falling back to js if not, which should make us
compatible with older versions of chrome and chromium.
11 years ago
lilia 8d323a4d71 Hooray for options 11 years ago
lilia 59f22ecb26 Clean up after crazy emscripten fueled rager
Man you shoulda been there. Code was compiling all over the damn place.
It was wild.

Seriously though. Ignore that intermediate compiled file. What happens
in build stays in build.
11 years ago
lilia b4f4f87a7c Add emscripten-compiled curve25519 module
Build with `grunt compile && grunt concat:curve25519` after installing
emscripten.

Enable by either (a) not loading nativeclient.js or (b) setting
`textsecure.NATIVE_CLIENT = false` before loading nativeclient.js.
11 years ago
lilia 74bfc9d04e Wrap some long lines 11 years ago
lilia 0a3c03025b Abstract nativeclient callback logic
The nativeclient.js module overrides
window.textsecure.registerOnLoadFunction with its own version. Otherwise
helpers will define a trivial placeholder for same.

The flag textsecure.NATIVE_CLIENT can be set anywhere ahead of
nativeclient.js, but is only acted on in nativeclient.js,
and crypto.js.
11 years ago
lilia 69c52d51b3 Abstract out curve25519 tests
Also rename the internal variable in crypto.js to be a little more
explicit about which curve we're dealing with.
11 years ago
lilia 79925fd227 Removed now unused copy of getRandomBytes 11 years ago
lilia 9f676af9bb Refactor crypto.js and native client interface
NB: this diff is best viewed with --ignore-whitespace

Distills crypto.js down to the hard cryptoey bones. It pulls from
webcrypto for aes and hmac, and from native client for curve25519 stuff
or potentially another object implementing the handful of needed
curve25519 functions.

Everything else formerly known as crypto, including session storage and
management, axolotl, etc.. is now protocol.js. The separation is not
quite perfect, but it's a big step.

nativeclient.js now enables talking to the native client module through
a high level interface as well as registering callbacks that will be
executed once the module is loaded. And it has tests!

Finally, this commit removes all references to the "testing_only"
object, preferring to run tests on textsecure.crypto instead.
11 years ago
lilia cd4b98d426 Remove 1mod8
27b5bf54cc
11 years ago
lilia db76c7e164 Initialize session.currentRatchet.previousCounter 11 years ago
lilia aa937ae1d1 Add attachment inputs to new conversation form
Fixes reference error to 'map' on undefined attachments list.
11 years ago
lilia f7d92ccb5b Bowerize backbone.localstorage 11 years ago
lilia 51de1d46c8 Update ByteBuffer.js
Such update. Very versioned, wow.
11 years ago
Arlo Breault bc5dea62c3 Use FileReader to base64 encode attachments
* Implements #82
11 years ago
lilia 6e3014895b Fix cryptojs hmac implementation
Apparently the bowerized version of cryptojs's WordArray.create doesn't
handle arraybuffers correctly.
11 years ago
lilia 6e86a2b7cf Switch libphonenumber to bower 11 years ago
lilia 508c59e05c Rename bower_components
To components. Because tab-completion works better when there aren't two
things starting with bower, and shorter names are nicer to deal with in
general.
11 years ago
lilia ca7ba43b13 Fix overly hidden elements on registration page
Latest bootstrap css is really aggressive about hiding things.
11 years ago
lilia 800e5ab703 Pass protobuf attachment ids as strings
Latest protobuf.js requires that we pass in the sign value when making
longs from strings, ex: dcodeIO.Long.fromString(id, true);

However, it does the string->long conversion automatically if its given
a string for a fixed64 field, so we can pass our string ids right in!
ftw
11 years ago
lilia 9c568ed0b8 Don't warn on missing message bodies
A message can be blank if it has an attachment
11 years ago
lilia df0eaf622a Clean up test files
Moved all test code into /test. Renamed test.js to crypto_test.js.
(Let's try to keep test files topical.) Merged test_views.html and
test.html into a single test/index.html.

Todo: use Grunt to generate test/index.html from index.html and files
found in /test. Also, write more tests.
11 years ago
lilia 987744cd79 Default avatars
Someday you'll be able to edit your avatar. Until then, put a bird on
it.
11 years ago
lilia 2a7d3996bb Remove unused popup.html
And popup.js is now index.js, illustrating its importance as the titular
javascript file.
11 years ago
lilia 1c76c0b546 Move storage objects to their own files
Greatly reduce the size of the ignominiously named helpers.js.
11 years ago
lilia b92c5bb84e Unused function 11 years ago
lilia ddd6f1a944 remove another unused function 11 years ago
lilia 80e3fadcb1 Remove unused *MACWithVersionByte functions 11 years ago
lilia 39505c81b1 Finish up webcrypto integration, Fixes #72
We now correctly and opportunistically use the webcrypto API if
available, polyfilling if it's not detected. This change also includes a
layer of abstraction over the webcrypto interface so we no longer have
to deal with key-imports or algorithm names all over the place. Since we
no longer support AES-CTR, code outside this file can simply call
`textsecure.subtle.<encrypt|decrypt|sign>(key, data [, iv])`.
11 years ago
lilia 244e051fc3 Add importKey to webcrypto.js 11 years ago
Matt Corallo 37ef492642 Remove now-broken axolotl test 11 years ago
Matt Corallo 2e7b5b46e3 Remove AES-CTR entirely 11 years ago
Matt Corallo da0c63fb1b Add (untested) AES-CBC switch from v3 (fs loss resulted in old tested version being lost) 11 years ago
Matt Corallo 3a39602385 Fix borked spacing in webcrypto.js 11 years ago
Matt Corallo 73f867f7de rm useless GPL, license testvectors under X11 (ie 3-c MIT + advertising provision) 11 years ago
Matt Corallo 68a42a6ae7 Give up on webcrypto :( 11 years ago
lilia 21225b2074 Save outgoing attachments 11 years ago
lilia b69db59ad4 Fix buffer concatenation
TypedArray.prototype.set doesn't handle ArrayBuffers correctly (it
writes all zeros). Instead, wrap each ArrayBuffer in a typed array
for concatenation.
11 years ago
lilia e07759a93c Fix CBC encryption, test 11 years ago
lilia e35148add8 No, jQuery, don't processData!
processData (default: true)
Type: Boolean
By default, data passed in to the data option as an object (technically,
anything other than a string) will be processed and transformed into a
query string, fitting to the default content-type
"application/x-www-form-urlencoded". If you want to send a DOMDocument,
or other non-processed data, set this option to false.

https://api.jquery.com/jQuery.ajax/
11 years ago
lilia 211129475c Fix attachment ids
Parse attachment ids out of the attachment pointer url and return them
as strings because the copy parsed by JSON suffers a loss of precision.
Convert them to and from the format expected by the protobuf using
facilities from decodeIO.Long.
11 years ago
lilia eebb14599f Well that's handy 11 years ago
lilia 674b173c59 Add support for cbc encryption 11 years ago
lilia 229007040c Basic frontend support for image attachments 11 years ago
lilia d362d0d978 Autoscroll conversation views
Scroll to the bottom (most recent) message in the conversation when it
is opened, when we send a message, and when we receive a message.
11 years ago
lilia 4675cdf3f2 Webcrypto won't go down without a fight
Turns out that assigning a new object to window.crypto.subtle
is not so easy. That's probably a good thing.
11 years ago
lilia a4b25f7df1 Disable the real webcrypto
Sadly, we are not quite compliant with the WC3 webcrypto spec
due to our insistance on passing around key data in plain old
ArrayBuffers.

Also converted whitespace.
11 years ago
lilia d67b723f4f Highlight the selected thread 11 years ago
lilia 19dac1f3df Decorate incoming group messages
with numbers and image placeholders, so you know who's saying what.
11 years ago
lilia 78166365c7 Fix new message number validation 11 years ago
lilia 838283f28b Send acks instead of closing and opening the socket
Hopefully the real fix for #67 until we get protocol-level pings from
the wc3 api.
11 years ago
lilia 6e2a85ccf1 wip new message phone number validation 11 years ago
lilia e831c649bd Require a mandatory websocket reset once a minute
Compensate for the lack of keepalives in the WebSocket API.

Fixes #67
11 years ago
lilia a3bf40e852 Shorten websocket time out. Fixes #67 11 years ago
lilia 3a00e49791 Open the most recent conversation on load 11 years ago
lilia 1023ea1732 Refactor textsecure.protos -> textsecure.protobuf
DRY up protobuf declarations and move to a slightly briefer naming
convention.

Also dropped some ArrayBuffer -> string conversions as
ProtoBuf.js handles ArrayBuffers just fine, and in fact, more
efficiently than strings.

Finally, dropped the btoa() wrappers, because that incurs an extra
string -> string conversion before the protobuf's internal string ->
array buffer conversion. In lieu of btoa, we can simply pass in the
optional string encoding argument to the protobuf's decode method,
which in these cases should be 'binary'.

Related: #17
11 years ago
lilia 03cc667e48 Standardize some whitespace
The preferred style is 4 spaces.
11 years ago
Arnaud Benard e568e2c528 Fixes #61 - Order by timestamps with tests 11 years ago
lilia cc5327dbc9 Fix group loop
All the group messages were being sent to the last recipient in the
list, due to the persistence of `var number` in later loops and async
calls. An easy mistake to make, when you use for instead of each.
11 years ago
lilia ac5c359053 Fix strange loop in sendMessageProto
Don't declare a new `var i`  within the scope of an existing `var i`.

Fixes #63
11 years ago
lilia cd55c0a1f1 Put groupid back in id field also 11 years ago
lilia 0bd5f3e3c2 If for some reason a group has no name, provide a default 11 years ago
lilia 0036e4ef74 Store group ids as strings 11 years ago
lilia 8288e298fc Group ids should be converted to ArrayBuffers for transport 11 years ago
lilia 143254cec8 Group ids are stored in groupId 11 years ago
lilia bbe57ef0bf Stringify incoming group ids
Otherwise when we try to make their local storage keys they look like:
"egroupByteBuffer(offset=4,markedOffset=-1,length=28,capacity=112)"
11 years ago
lilia 4f21bbd21f Use textsecure.messaging to create groups
Not textsecure.storage. Sigh. Also accomodate the fact that
the group id is not returned directly, but rather at the end
of a promise chain.
11 years ago
lilia fa4c385598 Make initial timestamp on a thread match the 1st message 11 years ago
lilia f14cd2eed1 Don't validate presence of thread id
It's undefined until the first save();
11 years ago
lilia 7e9c0e2394 Group ids should be strings (or stringables)
ArrayBuffer was a bad choice.
11 years ago
lilia 6db3eeb52e Convert incoming timestamps into numbers
Fixes #59

protip: don't use << for anything over 2^32. The operands of all bitwise
operators are converted to signed 32-bit integers
11 years ago
lilia d7edfd4efb Remove reference to undefined function 11 years ago
lilia 43f4f6cf99 Open a group's view after it's created 11 years ago
lilia 320d1f18ae Fix exception when protbuf-encoding groupIds
An exception is thrown when protobuf tries to encode a number as the
group id, which is declared to have type 'bytes'.

Fix by make it an ArrayBuffer instead, and increase the length to 16,
which is what the Android client uses:

c632b32ff8/src/org/thoughtcrime/securesms/database/GroupDatabase.java (L222)
11 years ago
lilia 5b0573293f Fix references to GroupContext Type ENUM values 11 years ago
lilia 01f9fc1f17 More frontend groups fixes 11 years ago
lilia e89e691957 Fix bug in groupId generation
Previously, if calling createNewGroup with an undefined groupId,
no groupId was generated.

This occurred because no entry for "group" + undefined exists in
localStorage, which caused this code to think undefined was a
valid group id.

Fixed by adding `|| groupId == undefined` to the while clause.
Also decoupled the groupId collision check for clarity.
11 years ago
lilia dc41ebf701 Small frontend fixes for the new group view 11 years ago
lilia 2bd77693e1 Refactor options page and style using bootstrap 11 years ago
lilia 81e4af5827 Move phonenumbery utils to libphonenumber object
Slowly whittling away at helpers.js...
11 years ago
lilia 9fc14cfa30 Remove erroneous comment re: MDN copyright
In fact, the code samples we have copied from MDN are declared to be
public domain (see link below):

  "Code samples added on or after August 20, 2010 are in the public
  domain."

https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses

AFAICT we're using code from this page, last updated 10/4/14:
https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding
11 years ago
lilia 75e78caec8 Function-wrap options.js 11 years ago
lilia 683c373943 Relaxes verification code validation
When codes are sent they are formatted as xxx-xxx. Previously when I
would paste these from GVoice they failed validation thanks to the dash
and whatever whitespace I happened to grab.
11 years ago
lilia 27708cd8d7 Switch to staging. -ca is now production 11 years ago
lilia 0f4b53c176 Update records list in BBLocalStorage on fetch
Previously, would only update the known messages.
11 years ago
lilia 2288f8adc1 Fix new group ui not showing 11 years ago
lilia 266600e5ab There's no need to wrap this function inside a function afaict 11 years ago
lilia ae98b8680f Fix whitespace in popup.js
Our official standard is 4 space indentation.
11 years ago
lilia ef066ea9d2 Make conversations open when they are created 11 years ago
lilia 230d24a69e Views already have a #remove() 11 years ago
lilia db86abdf70 Add list view tests
Also,
 * moved fetch out of the list view
 * removed unused #last() function
 * put test setup lines in their own tiny file.
 * added data-cover to view script tags for code coveage reports.
11 years ago
lilia ad7456b367 Refactor away this poorly named and overloaded file 11 years ago
lilia b9640a54bd Move new convo stuff to its own file 11 years ago
lilia 9af18ce6ae Encapsulate page layout js
The layout class is the only class that should have knowledge of
page-level constant markup, such as #gutter and #contacts, and
should be pretty much the only place we find elements by id (with
the exception of template elements).

This change removes references to #gutter from views. Rather than
hardcoding assumptions about page layout, view elements should
ask the layout to insert themselves into the main content area by
calling Whisper.Layout.setContent.
11 years ago
lilia 5ddcc516e4 remove extra insertion, it's already happening 11 years ago
lilia 2f0b0f7a1b Get overflow scrolls working
Had to resort to a resize event handler.
A bit slow at times, but it works.
11 years ago
lilia 546cdf82cb Fix some markup issues
* Remove spurious search div
* Fix nested uls
* Use class name selected, not closed (the inverse)
* Restor nacl div
11 years ago
lilia c2beda8e40 Get single recipient message composition working again 11 years ago
lilia c034ac8267 Refactor components for the main content section
Each conversation views now manages its own separate elements
rather than all binding to a shared #conversation element, and
similarly for message composition ui.

Also includes the beginnings of group creation UI (not working yet),
featuring bootstrap-tagsinput field for entering group recipients
11 years ago
lilia 8d83a8fb27 This element is constant, so let's bootstrap it 11 years ago
lilia 5f74a60364 Format thread timestamps 11 years ago
lilia 44f272a181 Get messages sending with new ui
Also convert index.html to 4-space indentation.
11 years ago
lilia 95c31629b7 get frontend rendering with new markup/css 11 years ago
lilia 850a91c77d Fix message sending 11 years ago
lilia 0741c74618 Don't recreate views unnecessarily
Let ConversationListItemView save a reference to its corresponding
ConversationView. This lets it render or delegate/undelegate events
when opening and closing a conversation.

Similarly for ConversationView itself, which contains a MessageListView.
11 years ago
lilia 9d0be46a53 Close an open conversation before opening another 11 years ago
lilia bbb5d56516 Don't reopen a currently selected conversation 11 years ago
lilia 98cfc1b701 Remove old convo compose view 11 years ago
lilia 511b121a2f Refactor conversation view into two classes
One that resides in the left hand column as a list item, and another
which displays in the main column and handles ui events therein.
11 years ago
lilia 6ff6ef07a9 Parse the template before binding render to an event 11 years ago
lilia d615a5a18b Let list view changes the color of selected conversations 11 years ago
lilia dc957415c2 Cull dead code
Most of this no longer needed because of templating and list views.
11 years ago
lilia 9082781e09 Make header and footer/form work without overflowing 11 years ago
lilia df95a7f71a Move ui init out of nacl callback and remove some lines that no longer apply 11 years ago
lilia def32f42d4 New layout/design
Two column layout and style tweaks. Templatized conversation views.
Generalized list view.
11 years ago
lilia 6d5e32bca8 Don't make a new collection on every call to thread.messages() 11 years ago
lilia 7e20838128 Rename file 11 years ago
lilia 4724c96ecb Use $.find so these locals can go away 11 years ago
lilia 2e3d89ef78 Use mustache template for message rendering 11 years ago
lilia 25fecc949e Condense some code using Backbone.View's event framework 11 years ago
lilia 06ff6c3087 Let thread collection double as contacts db
When a thread is 'destroyed' from the UI we delete its messages and mark
the thread as inactive, (in other words, keep it around as contact info).
Additionally, we only load active threads when initializing the UI, and
reactivate threads when new messages are added to them.

Conflicts:
	js/models/messages.js
	js/models/threads.js
	js/views/conversations/show.js
11 years ago
lilia c6b79236d9 Fix whitespace, lint 11 years ago
lilia ebf1b3352f Use separate message collections for each thread to facilitate lookup and lazy loading 11 years ago
Matt Corallo d6d17eaf19 Remove unused function 11 years ago
Matt Corallo 3696214edc Add missing localStorage.clear() 11 years ago
Matt Corallo 28779e0b35 Fix tests by returning promises 11 years ago
Matt Corallo 90eb9cb0c8 Remove ping, update to latest spec proposal 11 years ago
Matt Corallo f6f35c5b61 Fix a missing function and dont blow up on delivery receipts 11 years ago
Matt Corallo d9f53d4c01 Fix not-allowed inline scripts error 11 years ago
Matt Corallo a6b0d1f84b Add entirely untested secondary device init 11 years ago
lilia 2751d0e884 Such tests. Very mocha. Much chai. Amaze!!!
ERHMAGERRRD testing frameworks are so the best. Removed all our custom
code for ensuring test exclusivity and doneness and isolating callbacks
and everything. mocha does it all for us, and makes it pretty.

Also rather than return a long chain of promises that eventually resolve
to truthiness, we now use chai to make assertions about what is good and
right in the world.

Recommended reading:
  https://visionmedia.github.io/mocha
  http://chaijs.com/api/assert/
11 years ago
Matt Corallo 6455da5c9a Refactor a bunch of stuff re: session closing, add test cases 11 years ago
Matt Corallo c427da04f0 Add closeSession tests as Alice and fix re-requesting prekeys 11 years ago
Matt Corallo 6f3ee151f3 Add a BOB test-case around session closure 11 years ago
Matt Corallo a6426194ef Update BOB test cases 11 years ago
Matt Corallo 957587bd9a Add identity keys to MAC, begin updating test cases 11 years ago
Matt Corallo eab0911d3d I lied, there is no verification tag 11 years ago
Matt Corallo 85f33345ab Move test shuffling to js/testvectors.js 11 years ago
Matt Corallo 0088721343 Move AXOLOTL test vectors to js/testvectors.js 11 years ago
Matt Corallo 07f79cb4bf Fix tester 11 years ago
Matt Corallo 7013c5e031 First steps towards BOB test vectors 11 years ago
Matt Corallo ebcfd4736e Fix session lookup in duplicate prekeymessage case 11 years ago
Matt Corallo 5040bfbe44 Fix pending verifications 11 years ago
Matt Corallo a76ae2f1f8 Add verification tags, make alice tests strict(ish) again 11 years ago
Matt Corallo 287b55120d First cut of ALICE test vectors 11 years ago
Matt Corallo a8908646aa Fix null flags in v3 11 years ago
Matt Corallo 0d4ae6a8cb Fix undefined variable in for's (browser update to strict mode?) 11 years ago
Matt Corallo de83429962 v3 steps 11 years ago
Matt Corallo 66bf371aa7 Use staging server (ie update to server keys v2) and protocolv3 11 years ago
Matt Corallo 53f8ac9ad9 Generate signed keys (breaks registration) 11 years ago
Matt Corallo 4c3ee6f23b Compare equality w/o getString (in the future) 11 years ago
Matt Corallo 3190fe97f9 HMAC Update for Protov3 11 years ago
Matt Corallo b5c6e3d101 JS ed25519 11 years ago
Matt Corallo b94ba6b726 USE_NACL = true 11 years ago
Matt Corallo 7d27df9868 Report testing done 11 years ago
Matt Corallo a2da4fffb0 Remove useless function 11 years ago
Marco 13a9329bcf improved number validation (based on google's libphonenumber) 11 years ago
Matt Corallo 92514ad08f Fix missing baseKey 11 years ago
Matt Corallo ceca03c5d0 Close chainKey.key 11 years ago
lilia ce3c5eb909 Refactor conversation list view
Pull apart UI classes for displaying and creating threads.
Also get rid of ugly alert popup in favor of Whisper.notify.
11 years ago
Matt Corallo 1ec6b0aed6 Better TODO wording 11 years ago
Matt Corallo 12a849957a Refresh groups on (probably) new identity key (maybe more often?) 11 years ago
Matt Corallo 0f126fc0f8 Keep track of number->groups, add TODO to refresh, other tweaks 11 years ago
Matt Corallo e495e8e3db Group updates to match real protocol and get better checking 11 years ago
lilia ec900e0ea4 Fix double display of outgoing messages 11 years ago
lilia a09a4776d3 Fix incoming message display/storage
There were a few problems.

1. The message event was being triggered in background, not popup
2. The initial message/thread fetches from localStorage were mis-ordered
3. The timestamp wasn't being extracted from the right place
4. #3 caused messages to fail validation and not be saved

1-3 are fixed. To address 4 I switched validate() to log a warning
instead of preventing save.
11 years ago
Matt Corallo c90b9a5c59 Some group update verification 11 years ago
Matt Corallo b1ec02fa92 Group API 11 years ago
Matt Corallo c953c6c16d closeSession 11 years ago
Matt Corallo d0fd3e94d8 sendMessage refactor, initial group stuff (breaks message storage) 11 years ago
Matt Corallo fb2aa6144c Merge pull request #45 from codedust/extractchrome
moved some chromium-specific code into chromium.js
11 years ago