Commit Graph

2346 Commits

Author SHA1 Message Date
str4d
19fdf3ffd0 Fix test broken by #78 2016-06-17 04:48:13 +00:00
Ernir Erlingsson
e7dce02709 Merge branch '402-blog-client-implementation' into 'master'
Blog Client with Factories and Validator

This implements a simple initial blog client that covers the basic blog actions, but no deletion/removal of blogs, yet.

Classes for Blogs and Blog Post Headers have been introduced along with the associated factories.

A `BlogPostValidator` has been added that validates incoming blog posts.

Closes #402
Closes #404

See merge request !212
2016-06-15 20:26:35 +00:00
Ernir Erlingsson
f823b8ba4c Merge branch '78-trust-indicators' into '402-blog-client-implementation'
New Trust Level Indicator Replaces The Stars

This implements a generic `TrustIndicatorView` with a `setTrustLevel()`
method which updates the drawable according to the `Author.State`.

It also removes unused files from the repo.

This is based on !212 and should only be merged after it.

Closes #78

See merge request !217
2016-06-15 20:17:59 +00:00
Torsten Grote
dc048187f5 New Trust Level Indicator Replaces The Stars
This implements a generic `TrustIndicatorView` with a `setTrustLevel()`
method which updates the drawable according to the `Author.State`.

Closes #78
2016-06-15 12:41:43 -03:00
Torsten Grote
da68ef78f1 Blog Client with Factory and Validator
This implements a simple initial blog client that covers the basic blog
actions, but no deletion/removal of blogs, yet.

Classes for Blogs and Blog Post Headers have been introduced along with
the associated factories.

A `BlogPostValidator` has been added that validates incoming blog posts.

Closes #402
Closes #404
2016-06-15 11:16:28 -03:00
Torsten Grote
bbed673150 Merge branch '433-forum-persistance' into 'master'
fix persistance

Closes #433

See merge request !216
2016-06-15 14:11:42 +00:00
Ernir Erlingsson
69b0bec033 fix persistance 2016-06-14 23:53:05 +02:00
str4d
a11e30c2b3 Merge branch '390-change-password' into 'master'
Add a UI for changing the password

Closes #390

See merge request !213
2016-06-11 22:51:24 +00:00
str4d
c5708ee3ce Add a UI for changing the password 2016-06-11 22:49:45 +00:00
Torsten Grote
e96838e731 Merge branch '430-npe-in-forumsharingstatusactivity' into 'master'
Fix NPE in ForumSharingStatusActivity by only accessing group in contact list

Only access group in contact list where it is guaranteed to exist.

Closes #430

See merge request !211
2016-06-08 13:49:09 +00:00
Torsten Grote
6697b06530 Fix NPE in ForumSharingStatusActivity
by checking if a group ID exists.

Closes #430
2016-06-08 10:47:47 -03:00
Torsten Grote
1bb17a3979 Merge branch '309-client-layer-events-for-messaging' into 'master'
Client layer events for messaging

Adds and uses a new `PrivateMessageReceivedEvent` and eliminate the need for an event for adding local messages. Both done in separate commits.

This addresses part of #309

See merge request !208
2016-06-08 13:37:34 +00:00
Torsten Grote
9d826631e9 Add private message to list right away, so eliminate need for an event 2016-06-08 10:31:26 -03:00
Torsten Grote
b26acdf228 Introduce a PrivateMessageReceivedEvent and use it in the Android app 2016-06-08 10:31:26 -03:00
Torsten Grote
69fba1aa17 Merge branch '388-forum-sharing-race-condition' into 'master'
Address Race-Condition in Forum Sharing

When Two Contacts Share Same Forum with each other at the same time a race condition causes them both to delete each other's invitation. This is solved by an Alice/Bob test as suggested in #388.

See merge request !205
2016-06-08 13:29:12 +00:00
Torsten Grote
1a1dd80810 Merge branch '408-forum-list-unread-posts-badges' into 'master'
Adds badges to the forum list that indicate unread posts

This MR adds  badges to the forum list that indicate unread posts. It does so by extending the compound view `TextAvatarView` and provides convenient setters that take care of the required UI changes. The new badge can also be used to indicate a problem with the forum.

![device-2016-06-02-134048](/uploads/133f365f5654be304f590a4f5b667d06/device-2016-06-02-134048.png)![device-2016-06-02-134453](/uploads/423a88f6306a558828181f0c539aa1cb/device-2016-06-02-134453.png)

I decided not to check if the forum is shared from someone or with someone and indicate a problem in this case, because this requires iterating two times over all contacts and their group metadata for each forum. If someone considers it important to check for this information, we can create a ticket for doing this within the forum and not in the forum list.

See merge request !207
2016-06-07 14:36:42 +00:00
Ernir Erlingsson
02f432c04e Merge branch '409-blog-fragment-in-navigation-drawer-with-tabs' into 'master'
Blog Fragment in Navigation Drawer with Tabs

This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Please note that the header in the navigation drawer is just provisional. I am sure @Megalox can design a better one.

![device-2016-06-02-191101](/uploads/ddffee792f67fad01158d7adc7ca904d/device-2016-06-02-191101.png)
![device-2016-06-02-191048](/uploads/a5e6def118646a02c6bcbf17e0398484/device-2016-06-02-191048.png)

Closes #409

See merge request !210
2016-06-06 09:48:08 +00:00
Torsten Grote
3f838b0472 Blog Fragment in Navigation Drawer with Tabs
This replaces the custom layouts in the navigation drawer with a
`NavigationView` and adds a menu entry for Blogs.

A Main Blogs fragment is added that holds a `TabLayout` and a
`ViewPager`. Five tabs are already added, but they just have a single
placeholder fragment that is to be replaced by the actual fragments.

Closes #409
2016-06-03 13:51:31 -03:00
Torsten Grote
5d06f42000 This commit adds badges to the forum list that indicate unread posts.
It does so by extending the compound view `TextAvatarView` and provides
convienient setters that take care of the required UI changes.
The new badge can also be used to indicate a problem with the forum.

Closes #408
2016-06-03 12:44:03 -03:00
Torsten Grote
4acb59b22a Address Race-Condition when Two Contacts Share Same Forum
with each other at the same time.

Closes #388
2016-06-02 14:02:32 -03:00
str4d
bba7083660 Merge branch '422-forum-subtree-duplicates' into 'master'
fixed sub-tree duplicate bug

Closes #422

See merge request !206
2016-06-02 00:27:08 +00:00
Ernir Erlingsson
e3fc015ec3 fixed sub-tree duplicate bug and also wrong reply count 2016-06-01 23:32:19 +02:00
Ernir Erlingsson
441fce8500 fixed forum crash bug 2016-05-31 23:12:33 +02:00
Ernir Erlingsson
a58fb72ab1 Merge branch '122-threaded-discussion-ui' into 'master'
122 threaded discussions

This branch contains the complete code for the nested forums (UI & back-end).

* This branch has an optional randomized set of dummy test data, uncomment one line in ForumActivity.java and then open up any forum.


See merge request !201
2016-05-31 16:06:22 +00:00
Ernir Erlingsson
86039b81c0 Forum, nested discussions front end UI/UX, rev 2 2016-05-30 23:57:01 +02:00
str4d
661140f623 Merge branch '382-message-dependencies-2' into 'master'
Message Dependencies

This MR adds a new table to the database to hold message dependencies.
It introduces two more message states  (pending and delivered) and completely changes the validation and message delivery logic.

Since this is a **very invasive** change, please **review carefully**. It is better to catch issues now than having to debug things later. If you notice an area without tests, please let me know. I tried to have tests for all changes.

Unfortunately, this MR turned out rather large, but most of it are actually tests and you can review one commit after the other without needing to see the full changelog.

In order to reflect the new states, things that were previously true for `VALID` messages have been changed to now be true for `DELIVERED` messages. This might have changed the semantics in some places and can have unindented side-effects.

The `DatabaseComponent` was extended with methods for:
* adding dependencies
* getting dependencies and states of a message
* getting messages that depend on a message (dependents) and their states
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

The `valid` column in the database was renamed to `state` along with the associated methods to better reflect its new extended meaning.

Since pending messages should not be available to clients, many database queries have been modified to only return results for delivered messages. I might have missed some. Please check carefully. Also you might want to think about how you could create arbitrarily large transactions by sending malicious messages.

Please note that the database version was bumped in this MR.

Closes #382

See merge request !198
2016-05-28 00:20:39 +00:00
str4d
19b6afa69f Move new methods in Database interface to match existing alphabetic sorting 2016-05-28 00:17:17 +00:00
str4d
7ac7fae30e Update comments 2016-05-28 00:16:24 +00:00
Torsten Grote
d3b83a50a6 Let the ForumValidator return parent posts as dependency
and add integration tests that make sure that dependencies are handled
properly.
2016-05-26 13:49:59 -03:00
Torsten Grote
5561532c5d Implement new message validation logic
that handles message dependencies reported from clients.

The MessageValidatedEvent has been renamed into a MessageDeliveredEvent
since there were no real use cases for the former any more.
2016-05-26 13:49:59 -03:00
Torsten Grote
b03d0a206b Add Message Dependencies to Database
This adds a new table to the database to hold message dependencies.
It introduces two more message states: pending and delivered
The valid column in the database was renamed to state to better reflect
its new extended meaning.

The DatabaseComponent was extended with three methods for:
* adding dependencies
* getting dependencies of a message
* getting messages that depend on a message (dependents)
* getting messages to be delivered (by startup hook)
* getting pending messages to be possibly delivered (by startup hook)

In order to reflect the new states, things that were previously true for
VALID messages have been changed to now be true for DELIVERED messages.

Since pending messages should not be available to clients, many database
queries have been modified to only return results for delivered
messages.

All added methods and changes should come with updated unit tests.

Please note that the database version was bumped in this commit.
2016-05-26 13:49:03 -03:00
Ernir Erlingsson
512940e82b Merge branch '393-message-tree' into 'master'
Sort threaded messages generic

Constructed a generic that we can use to sort threaded messages.

Closes #393

See merge request !203
2016-05-26 11:13:06 +00:00
Ernir Erlingsson
d2ba7c9b7f generic sorted message tree 2016-05-25 22:12:20 +02:00
Torsten Grote
a652f1a5d7 Merge branch '122-forum-manager' into 'master'
added parent id to metadata and a unit test

The parent id, a necessary attribute for nested forums, was not being added to the metadata in the forum manager. Additionally, a simple forum manager unit was created.

See merge request !202
2016-05-24 18:13:15 +00:00
Ernir Erlingsson
21b237a629 ForumManager: Added parent id to metadata and a unit test 2016-05-24 15:12:37 -03:00
Torsten Grote
2a7990f5c4 Merge branch '334-nav-menu-button-crash' into 'master'
android.support.v7.widget.AppCompatButton -> Button to use AppCompat inflater

Fixes the following crash that occurs after upgrading to support 23.3.0:
https://code.google.com/p/android/issues/detail?id=174871

Closes #334.

See merge request !200
2016-05-20 14:12:11 +00:00
str4d
92d3e02c82 android.support.v7.widget.AppCompatButton -> Button to use AppCompat inflater
Fixes the following crash that occurs after upgrading to support 23.3.0:
https://code.google.com/p/android/issues/detail?id=174871
2016-05-20 03:30:10 +00:00
str4d
0d16dd0358 Merge branch '382-message-dependencies' into 'master'
Introduce a MessageContext class to be used by all validators

This change will allow to pass message dependencies from the client validators to the `ValidationManager`.

Please see my thoughts in #382 for more details.

See merge request !197
2016-05-20 02:49:04 +00:00
Torsten Grote
3f2b85ac0d Introduce a MessageContext class for more flexibility
This change will allow to pass message dependencies from the client
validators to the ValidationManager.
2016-05-20 02:46:37 +00:00
Torsten Grote
d0852d2265 Sorry for breaking master. Don't know how that happened :( 2016-05-19 21:33:38 -03:00
Torsten Grote
9149b82cc4 Merge branch '398-forum-sharing-status' into 'master'
Forum Sharing Status

The new activity shows who you are sharing a forum with and who shares a
forum with you. It is accessible from the overflow menu when in a forum.

![device-2016-05-13-153259](/uploads/2e1c651bc72094018dd0f97a37453d1b/device-2016-05-13-153259.png)

Closes #398

See merge request !191
2016-05-19 14:44:05 +00:00
Torsten Grote
b13bf66165 Add a new activity that shows sharing status of forum
The new activity shows who you are sharing a forum with and who shares a
forum with you. It is accessible from the overflow menu when in a forum.

Closes #398
2016-05-19 11:42:05 -03:00
Torsten Grote
8c2fd905a1 Merge branch '392-use-new-metadata-queries-for-forum-sharing' into 'master'
Handle invitations to the same forum by multiple contacts

This also uses the new metadata queries in the forum sharing client.

Please note that this is based on !184.

See merge request !188
2016-05-19 14:35:58 +00:00
Torsten Grote
38a4f73cdc Handle invitations to the same forum by multiple contacts
Closes #391
2016-05-19 11:34:28 -03:00
Torsten Grote
1a175beac9 Use new metadata queries in Forum Sharing Client
Closes #392
2016-05-19 11:34:28 -03:00
Torsten Grote
7e9ff40837 Merge branch '378-replace-bdf-with-classes-for-forum-sharing-client' into 'master'
Replace BDF data structures with classes in forum sharing client

This introduces two new classes for protocol session states: One for the sharer and one for the invitee.
The respective classes for protocol state machines and actions have been moved into these classes as inner classes.
The two new classes replace the `BdfDictionary` that was used before to represent the local state information of a forum sharing session.

A similar technique is used for local actions and protocol messages.

Local actions are just represented by one Enum and protocol messages have their own classes now that also handle serialization into BdfDictionaries and BdfLists.

Closes #378 

See merge request !184
2016-05-19 14:32:41 +00:00
Torsten Grote
bd01c3732e Also use dedicated classes to represent messages instead of BdfDictionary 2016-05-19 11:32:09 -03:00
Torsten Grote
9532a60f43 Use dedicated Enum for protocol Actions 2016-05-19 11:30:23 -03:00
Torsten Grote
d2722eed92 Turn local session state into its own class instead of BdfDictionary 2016-05-19 11:30:19 -03:00
Torsten Grote
886c8feb34 Merge branch '395-convert-createidentityactivity-to-xml' into 'master'
Turn the UI of `CreateIdentityActivity` into XML

Closes #395

See merge request !194
2016-05-19 14:24:35 +00:00