Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
54632d59
Commit
54632d59
authored
Feb 20, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding extra on error handler
parent
dd29cdd7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
129 deletions
+168
-129
DDPClientImpl.java
.../src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
+148
-113
AbstractDDPDocEventSubscriber.java
...et/android/service/ddp/AbstractDDPDocEventSubscriber.java
+20
-16
No files found.
android-ddp/src/main/java/chat/rocket/android_ddp/DDPClientImpl.java
View file @
54632d59
This diff is collapsed.
Click to expand it.
app/src/main/java/chat/rocket/android/service/ddp/AbstractDDPDocEventSubscriber.java
View file @
54632d59
...
...
@@ -99,23 +99,27 @@ public abstract class AbstractDDPDocEventSubscriber implements Registrable {
.
filter
(
event
->
event
instanceof
DDPSubscription
.
DocEvent
)
.
cast
(
DDPSubscription
.
DocEvent
.
class
)
.
filter
(
event
->
isTarget
(
event
.
collection
))
.
subscribe
(
docEvent
->
{
try
{
if
(
docEvent
instanceof
DDPSubscription
.
Added
.
Before
)
{
onDocumentAdded
((
DDPSubscription
.
Added
)
docEvent
);
//ignore Before
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Added
)
{
onDocumentAdded
((
DDPSubscription
.
Added
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Removed
)
{
onDocumentRemoved
((
DDPSubscription
.
Removed
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Changed
)
{
onDocumentChanged
((
DDPSubscription
.
Changed
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
MovedBefore
)
{
//ignore movedBefore
.
subscribe
(
docEvent
->
{
try
{
if
(
docEvent
instanceof
DDPSubscription
.
Added
.
Before
)
{
onDocumentAdded
((
DDPSubscription
.
Added
)
docEvent
);
//ignore Before
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Added
)
{
onDocumentAdded
((
DDPSubscription
.
Added
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Removed
)
{
onDocumentRemoved
((
DDPSubscription
.
Removed
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
Changed
)
{
onDocumentChanged
((
DDPSubscription
.
Changed
)
docEvent
);
}
else
if
(
docEvent
instanceof
DDPSubscription
.
MovedBefore
)
{
//ignore movedBefore
}
}
catch
(
Exception
exception
)
{
RCLog
.
w
(
exception
,
"failed to handle subscription callback"
);
}
},
throwable
->
{
}
}
catch
(
Exception
exception
)
{
RCLog
.
w
(
exception
,
"failed to handle subscription callback"
);
}
});
);
}
protected
void
onDocumentAdded
(
DDPSubscription
.
Added
docEvent
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment