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
ec6b3ca6
Commit
ec6b3ca6
authored
Jan 19, 2017
by
Tiago Cunha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up read notifications
parent
ec29bb97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
AbstractAuthedActivity.java
.../chat/rocket/android/activity/AbstractAuthedActivity.java
+6
-0
PushNotificationHandler.java
...ava/chat/rocket/android/push/PushNotificationHandler.java
+10
-2
No files found.
app/src/main/java/chat/rocket/android/activity/AbstractAuthedActivity.java
View file @
ec6b3ca6
...
@@ -10,6 +10,7 @@ import chat.rocket.android.RocketChatCache;
...
@@ -10,6 +10,7 @@ import chat.rocket.android.RocketChatCache;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.ServerConfig
;
import
chat.rocket.android.model.ddp.RoomSubscription
;
import
chat.rocket.android.model.ddp.RoomSubscription
;
import
chat.rocket.android.push.PushConstants
;
import
chat.rocket.android.push.PushConstants
;
import
chat.rocket.android.push.PushNotificationHandler
;
import
chat.rocket.android.realm_helper.RealmListObserver
;
import
chat.rocket.android.realm_helper.RealmListObserver
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.realm_helper.RealmStore
;
import
chat.rocket.android.service.RocketChatService
;
import
chat.rocket.android.service.RocketChatService
;
...
@@ -64,6 +65,11 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
...
@@ -64,6 +65,11 @@ abstract class AbstractAuthedActivity extends AbstractFragmentActivity {
editor
.
putString
(
RocketChatCache
.
KEY_SELECTED_ROOM_ID
,
editor
.
putString
(
RocketChatCache
.
KEY_SELECTED_ROOM_ID
,
intent
.
getStringExtra
(
PushConstants
.
ROOM_ID
));
intent
.
getStringExtra
(
PushConstants
.
ROOM_ID
));
}
}
if
(
intent
.
hasExtra
(
PushConstants
.
NOT_ID
))
{
PushNotificationHandler
.
cleanUpNotificationStack
(
intent
.
getIntExtra
(
PushConstants
.
NOT_ID
,
0
));
}
editor
.
apply
();
editor
.
apply
();
}
}
}
}
...
...
app/src/main/java/chat/rocket/android/push/PushNotificationHandler.java
View file @
ec6b3ca6
...
@@ -42,7 +42,11 @@ public class PushNotificationHandler implements PushConstants {
...
@@ -42,7 +42,11 @@ public class PushNotificationHandler implements PushConstants {
private
Random
random
=
new
Random
();
private
Random
random
=
new
Random
();
public
void
setNotification
(
int
notId
,
String
message
)
{
public
static
synchronized
void
cleanUpNotificationStack
(
int
notId
)
{
messageMap
.
remove
(
notId
);
}
private
synchronized
void
setNotification
(
int
notId
,
String
message
)
{
ArrayList
<
String
>
messageList
=
messageMap
.
get
(
notId
);
ArrayList
<
String
>
messageList
=
messageMap
.
get
(
notId
);
if
(
messageList
==
null
)
{
if
(
messageList
==
null
)
{
messageList
=
new
ArrayList
<>();
messageList
=
new
ArrayList
<>();
...
@@ -56,6 +60,10 @@ public class PushNotificationHandler implements PushConstants {
...
@@ -56,6 +60,10 @@ public class PushNotificationHandler implements PushConstants {
}
}
}
}
private
synchronized
ArrayList
<
String
>
getMessageList
(
int
notId
)
{
return
messageMap
.
get
(
notId
);
}
public
void
showNotificationIfPossible
(
Context
context
,
PushInteractor
pushInteractor
,
public
void
showNotificationIfPossible
(
Context
context
,
PushInteractor
pushInteractor
,
Bundle
extras
)
{
Bundle
extras
)
{
...
@@ -369,7 +377,7 @@ public class PushNotificationHandler implements PushConstants {
...
@@ -369,7 +377,7 @@ public class PushNotificationHandler implements PushConstants {
mBuilder
.
setContentText
(
fromHtml
(
message
));
mBuilder
.
setContentText
(
fromHtml
(
message
));
ArrayList
<
String
>
messageList
=
messageMap
.
ge
t
(
notId
);
ArrayList
<
String
>
messageList
=
getMessageLis
t
(
notId
);
Integer
sizeList
=
messageList
.
size
();
Integer
sizeList
=
messageList
.
size
();
if
(
sizeList
>
1
)
{
if
(
sizeList
>
1
)
{
String
sizeListMessage
=
sizeList
.
toString
();
String
sizeListMessage
=
sizeList
.
toString
();
...
...
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