Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
briar
Commits
2a29d333
Verified
Commit
2a29d333
authored
6 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Move private message creation off the crypto executor.
parent
30e0be9f
No related branches found
No related tags found
1 merge request
!1141
Move private message creation off the crypto executor
Pipeline
#3588
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-android/src/main/java/org/briarproject/briar/android/conversation/ConversationViewModel.java
+10
-17
10 additions, 17 deletions
...ect/briar/android/conversation/ConversationViewModel.java
with
10 additions
and
17 deletions
briar-android/src/main/java/org/briarproject/briar/android/conversation/ConversationViewModel.java
+
10
−
17
View file @
2a29d333
...
...
@@ -13,7 +13,6 @@ import org.briarproject.bramble.api.FormatException;
import
org.briarproject.bramble.api.contact.Contact
;
import
org.briarproject.bramble.api.contact.ContactId
;
import
org.briarproject.bramble.api.contact.ContactManager
;
import
org.briarproject.bramble.api.crypto.CryptoExecutor
;
import
org.briarproject.bramble.api.db.DatabaseExecutor
;
import
org.briarproject.bramble.api.db.DbException
;
import
org.briarproject.bramble.api.db.NoSuchContactException
;
...
...
@@ -69,8 +68,6 @@ public class ConversationViewModel extends AndroidViewModel
@DatabaseExecutor
private
final
Executor
dbExecutor
;
@CryptoExecutor
private
final
Executor
cryptoExecutor
;
private
final
TransactionManager
db
;
private
final
MessagingManager
messagingManager
;
private
final
ContactManager
contactManager
;
...
...
@@ -103,14 +100,12 @@ public class ConversationViewModel extends AndroidViewModel
@Inject
ConversationViewModel
(
Application
application
,
@DatabaseExecutor
Executor
dbExecutor
,
@CryptoExecutor
Executor
cryptoExecutor
,
@IoExecutor
Executor
ioExecutor
,
TransactionManager
db
,
MessagingManager
messagingManager
,
ContactManager
contactManager
,
SettingsManager
settingsManager
,
PrivateMessageFactory
privateMessageFactory
)
{
super
(
application
);
this
.
dbExecutor
=
dbExecutor
;
this
.
cryptoExecutor
=
cryptoExecutor
;
this
.
db
=
db
;
this
.
messagingManager
=
messagingManager
;
this
.
contactManager
=
contactManager
;
...
...
@@ -276,18 +271,16 @@ public class ConversationViewModel extends AndroidViewModel
private
void
createMessage
(
GroupId
groupId
,
@Nullable
String
text
,
List
<
AttachmentHeader
>
attachments
,
long
timestamp
)
{
cryptoExecutor
.
execute
(()
->
{
try
{
// TODO remove when text can be null in the backend
String
msgText
=
text
==
null
?
"null"
:
text
;
PrivateMessage
pm
=
privateMessageFactory
.
createPrivateMessage
(
groupId
,
timestamp
,
msgText
,
attachments
);
storeMessage
(
pm
,
msgText
,
attachments
);
}
catch
(
FormatException
e
)
{
throw
new
RuntimeException
(
e
);
}
});
try
{
// TODO remove when text can be null in the backend
String
msgText
=
text
==
null
?
"null"
:
text
;
PrivateMessage
pm
=
privateMessageFactory
.
createPrivateMessage
(
groupId
,
timestamp
,
msgText
,
attachments
);
storeMessage
(
pm
,
msgText
,
attachments
);
}
catch
(
FormatException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
private
void
storeMessage
(
PrivateMessage
m
,
@Nullable
String
text
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment