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
fe166ecf
Commit
fe166ecf
authored
Dec 18, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename Getter/Setter of RealmObject subclasses.
parent
f1292997
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
80 additions
and
80 deletions
+80
-80
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+7
-7
FileUploadProgressDialogFragment.java
...ent/chatroom/dialog/FileUploadProgressDialogFragment.java
+1
-1
UsersOfRoomDialogFragment.java
...d/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
+1
-1
MessageViewHolder.java
...cket/android/layouthelper/chatroom/MessageViewHolder.java
+2
-2
PairedMessage.java
...t/rocket/android/layouthelper/chatroom/PairedMessage.java
+4
-4
RoomListManager.java
...rocket/android/layouthelper/chatroom/RoomListManager.java
+3
-3
Message.java
app/src/main/java/chat/rocket/android/model/ddp/Message.java
+14
-14
MeteorLoginServiceConfiguration.java
...et/android/model/ddp/MeteorLoginServiceConfiguration.java
+2
-2
PublicSetting.java
...ain/java/chat/rocket/android/model/ddp/PublicSetting.java
+4
-4
RoomSubscription.java
.../java/chat/rocket/android/model/ddp/RoomSubscription.java
+10
-10
User.java
app/src/main/java/chat/rocket/android/model/ddp/User.java
+2
-2
FileUploading.java
...ava/chat/rocket/android/model/internal/FileUploading.java
+2
-2
GetUsersOfRoomsProcedure.java
...cket/android/model/internal/GetUsersOfRoomsProcedure.java
+2
-2
LoadMessageProcedure.java
...t/rocket/android/model/internal/LoadMessageProcedure.java
+3
-3
MethodCall.java
...n/java/chat/rocket/android/model/internal/MethodCall.java
+3
-3
MessageRenderer.java
...in/java/chat/rocket/android/renderer/MessageRenderer.java
+5
-5
CurrentUserObserver.java
.../rocket/android/service/observer/CurrentUserObserver.java
+1
-1
FileUploadingToS3Observer.java
...t/android/service/observer/FileUploadingToS3Observer.java
+1
-1
FileUploadingWithUfsObserver.java
...ndroid/service/observer/FileUploadingWithUfsObserver.java
+2
-2
LoadMessageProcedureObserver.java
...ndroid/service/observer/LoadMessageProcedureObserver.java
+1
-1
MethodCallObserver.java
...t/rocket/android/service/observer/MethodCallObserver.java
+1
-1
NewMessageObserver.java
...t/rocket/android/service/observer/NewMessageObserver.java
+4
-4
ReactiveNotificationManager.java
...android/service/observer/ReactiveNotificationManager.java
+5
-5
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
fe166ecf
...
...
@@ -93,7 +93,7 @@ public class RoomFragment extends AbstractChatRoomFragment
.
isNotNull
(
"hostname"
)
.
findFirst
()).
getHostname
();
userId
=
realmHelper
.
executeTransactionForRead
(
realm
->
User
.
queryCurrentUser
(
realm
).
findFirst
()).
get
_i
d
();
User
.
queryCurrentUser
(
realm
).
findFirst
()).
get
I
d
();
token
=
realmHelper
.
executeTransactionForRead
(
realm
->
Session
.
queryDefaultSession
(
realm
).
findFirst
()).
getToken
();
roomObserver
=
realmHelper
...
...
@@ -146,9 +146,9 @@ public class RoomFragment extends AbstractChatRoomFragment
@Override
public
void
onItemClick
(
PairedMessage
pairedMessage
)
{
if
(
pairedMessage
.
target
!=
null
)
{
final
int
syncstate
=
pairedMessage
.
target
.
getSync
s
tate
();
final
int
syncstate
=
pairedMessage
.
target
.
getSync
S
tate
();
if
(
syncstate
==
SyncState
.
FAILED
)
{
final
String
messageId
=
pairedMessage
.
target
.
get
_i
d
();
final
String
messageId
=
pairedMessage
.
target
.
get
I
d
();
new
AlertDialog
.
Builder
(
getContext
())
.
setPositiveButton
(
R
.
string
.
resend
,
(
dialog
,
which
)
->
{
realmHelper
.
executeTransaction
(
realm
->
...
...
@@ -264,7 +264,7 @@ public class RoomFragment extends AbstractChatRoomFragment
return
;
}
String
type
=
roomSubscription
.
getT
();
String
type
=
roomSubscription
.
getT
ype
();
if
(
RoomSubscription
.
TYPE_CHANNEL
.
equals
(
type
))
{
activityToolbar
.
setNavigationIcon
(
R
.
drawable
.
ic_hashtag_white_24dp
);
}
else
if
(
RoomSubscription
.
TYPE_PRIVATE
.
equals
(
type
))
{
...
...
@@ -284,8 +284,8 @@ public class RoomFragment extends AbstractChatRoomFragment
RecyclerView
listView
=
(
RecyclerView
)
rootView
.
findViewById
(
R
.
id
.
recyclerview
);
if
(
listView
!=
null
&&
listView
.
getAdapter
()
instanceof
MessageListAdapter
)
{
MessageListAdapter
adapter
=
(
MessageListAdapter
)
listView
.
getAdapter
();
final
int
syncstate
=
procedure
.
getSync
s
tate
();
final
boolean
hasNext
=
procedure
.
isH
asNext
();
final
int
syncstate
=
procedure
.
getSync
S
tate
();
final
boolean
hasNext
=
procedure
.
h
asNext
();
RCLog
.
d
(
"hasNext: %s syncstate: %d"
,
hasNext
,
syncstate
);
if
(
syncstate
==
SyncState
.
SYNCED
||
syncstate
==
SyncState
.
FAILED
)
{
scrollListener
.
setLoadingDone
();
...
...
@@ -322,7 +322,7 @@ public class RoomFragment extends AbstractChatRoomFragment
.
equalTo
(
"hasNext"
,
true
)
.
findFirst
();
if
(
procedure
!=
null
)
{
procedure
.
setSync
s
tate
(
SyncState
.
NOT_SYNCED
);
procedure
.
setSync
S
tate
(
SyncState
.
NOT_SYNCED
);
}
return
null
;
}).
onSuccessTask
(
task
->
{
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/FileUploadProgressDialogFragment.java
View file @
fe166ecf
...
...
@@ -68,7 +68,7 @@ public class FileUploadProgressDialogFragment extends AbstractChatroomDialogFrag
return
;
}
int
syncstate
=
state
.
getSync
s
tate
();
int
syncstate
=
state
.
getSync
S
tate
();
if
(
syncstate
==
SyncState
.
SYNCED
)
{
dismiss
();
}
else
if
(
syncstate
==
SyncState
.
FAILED
)
{
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/dialog/UsersOfRoomDialogFragment.java
View file @
fe166ecf
...
...
@@ -113,7 +113,7 @@ public class UsersOfRoomDialogFragment extends AbstractChatroomDialogFragment {
return
;
}
int
syncstate
=
procedure
.
getSync
s
tate
();
int
syncstate
=
procedure
.
getSync
S
tate
();
if
(
previousSyncState
!=
syncstate
)
{
onSyncStateUpdated
(
syncstate
);
previousSyncState
=
syncstate
;
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/MessageViewHolder.java
View file @
fe166ecf
...
...
@@ -65,7 +65,7 @@ public class MessageViewHolder extends RealmModelViewHolder<PairedMessage> {
.
attachmentsInto
(
attachments
,
hostname
,
userId
,
token
);
if
(
pairedMessage
.
target
!=
null
)
{
int
syncstate
=
pairedMessage
.
target
.
getSync
s
tate
();
int
syncstate
=
pairedMessage
.
target
.
getSync
S
tate
();
if
(
syncstate
==
SyncState
.
NOT_SYNCED
||
syncstate
==
SyncState
.
SYNCING
)
{
itemView
.
setAlpha
(
0.6f
);
}
else
{
...
...
@@ -79,7 +79,7 @@ public class MessageViewHolder extends RealmModelViewHolder<PairedMessage> {
private
void
renderNewDayAndSequential
(
PairedMessage
pairedMessage
)
{
//see Rocket.Chat:packages/rocketchat-livechat/app/client/views/message.coffee
if
(!
pairedMessage
.
hasSameDate
())
{
setNewDay
(
DateTime
.
fromEpocMs
(
pairedMessage
.
target
.
getT
s
(),
DateTime
.
Format
.
DATE
));
setNewDay
(
DateTime
.
fromEpocMs
(
pairedMessage
.
target
.
getT
imestamp
(),
DateTime
.
Format
.
DATE
));
setSequential
(
false
);
}
else
if
(!
pairedMessage
.
target
.
isGroupable
()
||
!
pairedMessage
.
nextSibling
.
isGroupable
()
||
!
pairedMessage
.
hasSameUser
())
{
...
...
app/src/main/java/chat/rocket/android/layouthelper/chatroom/PairedMessage.java
View file @
fe166ecf
...
...
@@ -20,8 +20,8 @@ public class PairedMessage {
*/
public
boolean
hasSameDate
()
{
return
nextSibling
!=
null
&&
DateTime
.
fromEpocMs
(
nextSibling
.
getT
s
(),
DateTime
.
Format
.
DATE
)
.
equals
(
DateTime
.
fromEpocMs
(
target
.
getT
s
(),
DateTime
.
Format
.
DATE
));
&&
DateTime
.
fromEpocMs
(
nextSibling
.
getT
imestamp
(),
DateTime
.
Format
.
DATE
)
.
equals
(
DateTime
.
fromEpocMs
(
target
.
getT
imestamp
(),
DateTime
.
Format
.
DATE
));
}
/**
...
...
@@ -29,7 +29,7 @@ public class PairedMessage {
*/
public
boolean
hasSameUser
()
{
return
nextSibling
!=
null
&&
nextSibling
.
getU
()
!=
null
&&
target
.
getU
()
!=
null
&&
nextSibling
.
getU
().
get_id
().
equals
(
target
.
getU
().
get_i
d
());
&&
nextSibling
.
getU
ser
()
!=
null
&&
target
.
getUser
()
!=
null
&&
nextSibling
.
getU
ser
().
getId
().
equals
(
target
.
getUser
().
getI
d
());
}
}
app/src/main/java/chat/rocket/android/layouthelper/chatroom/RoomListManager.java
View file @
fe166ecf
...
...
@@ -47,7 +47,7 @@ public class RoomListManager {
continue
;
}
String
type
=
roomSubscription
.
getT
();
String
type
=
roomSubscription
.
getT
ype
();
if
(
RoomSubscription
.
TYPE_CHANNEL
.
equals
(
type
)
||
RoomSubscription
.
TYPE_PRIVATE
.
equals
(
type
))
{
...
...
@@ -114,9 +114,9 @@ public class RoomListManager {
private
void
updateRoomItemView
(
RoomListItemView
roomListItemView
,
RoomSubscription
roomSubscription
)
{
roomListItemView
.
setRoomId
(
roomSubscription
.
getR
i
d
())
.
setRoomId
(
roomSubscription
.
getR
oomI
d
())
.
setRoomName
(
roomSubscription
.
getName
())
.
setRoomType
(
roomSubscription
.
getT
())
.
setRoomType
(
roomSubscription
.
getT
ype
())
.
setAlert
(
roomSubscription
.
isAlert
())
.
setUnreadCount
(
roomSubscription
.
getUnread
());
...
...
app/src/main/java/chat/rocket/android/model/ddp/Message.java
View file @
fe166ecf
...
...
@@ -38,59 +38,59 @@ public class Message extends RealmObject {
return
messageJson
;
}
public
String
get
_i
d
()
{
public
String
get
I
d
()
{
return
_id
;
}
public
void
set
_i
d
(
String
_id
)
{
public
void
set
I
d
(
String
_id
)
{
this
.
_id
=
_id
;
}
public
String
getT
()
{
public
String
getT
ype
()
{
return
t
;
}
public
void
setT
(
String
t
)
{
public
void
setT
ype
(
String
t
)
{
this
.
t
=
t
;
}
public
String
getR
i
d
()
{
public
String
getR
oomI
d
()
{
return
rid
;
}
public
void
setR
i
d
(
String
rid
)
{
public
void
setR
oomI
d
(
String
rid
)
{
this
.
rid
=
rid
;
}
public
int
getSync
s
tate
()
{
public
int
getSync
S
tate
()
{
return
syncstate
;
}
public
void
setSync
s
tate
(
int
syncstate
)
{
public
void
setSync
S
tate
(
int
syncstate
)
{
this
.
syncstate
=
syncstate
;
}
public
long
getT
s
()
{
public
long
getT
imestamp
()
{
return
ts
;
}
public
void
setT
s
(
long
ts
)
{
public
void
setT
imestamp
(
long
ts
)
{
this
.
ts
=
ts
;
}
public
String
getM
sg
()
{
public
String
getM
essage
()
{
return
msg
;
}
public
void
setM
sg
(
String
msg
)
{
public
void
setM
essage
(
String
msg
)
{
this
.
msg
=
msg
;
}
public
User
getU
()
{
public
User
getU
ser
()
{
return
u
;
}
public
void
setU
(
User
u
)
{
public
void
setU
ser
(
User
u
)
{
this
.
u
=
u
;
}
...
...
app/src/main/java/chat/rocket/android/model/ddp/MeteorLoginServiceConfiguration.java
View file @
fe166ecf
...
...
@@ -16,11 +16,11 @@ public class MeteorLoginServiceConfiguration
private
String
appId
;
//for Facebook
private
String
clientId
;
//for other auth providers
public
String
get
_i
d
()
{
public
String
get
I
d
()
{
return
_id
;
}
public
void
set
_i
d
(
String
_id
)
{
public
void
set
I
d
(
String
_id
)
{
this
.
_id
=
_id
;
}
...
...
app/src/main/java/chat/rocket/android/model/ddp/PublicSetting.java
View file @
fe166ecf
...
...
@@ -60,11 +60,11 @@ public class PublicSetting extends RealmObject {
return
defaultValue
;
}
public
String
get
_i
d
()
{
public
String
get
I
d
()
{
return
_id
;
}
public
void
set
_i
d
(
String
_id
)
{
public
void
set
I
d
(
String
_id
)
{
this
.
_id
=
_id
;
}
...
...
@@ -92,11 +92,11 @@ public class PublicSetting extends RealmObject {
this
.
value
=
value
;
}
public
long
get
_u
pdatedAt
()
{
public
long
get
U
pdatedAt
()
{
return
_updatedAt
;
}
public
void
set
_u
pdatedAt
(
long
_updatedAt
)
{
public
void
set
U
pdatedAt
(
long
_updatedAt
)
{
this
.
_updatedAt
=
_updatedAt
;
}
...
...
app/src/main/java/chat/rocket/android/model/ddp/RoomSubscription.java
View file @
fe166ecf
...
...
@@ -42,19 +42,19 @@ public class RoomSubscription extends RealmObject {
return
roomSubscriptionJson
;
}
public
String
get
_i
d
()
{
public
String
get
I
d
()
{
return
_id
;
}
public
void
set
_i
d
(
String
_id
)
{
public
void
set
I
d
(
String
_id
)
{
this
.
_id
=
_id
;
}
public
String
getR
i
d
()
{
public
String
getR
oomI
d
()
{
return
rid
;
}
public
void
setR
i
d
(
String
rid
)
{
public
void
setR
oomI
d
(
String
rid
)
{
this
.
rid
=
rid
;
}
...
...
@@ -66,11 +66,11 @@ public class RoomSubscription extends RealmObject {
this
.
name
=
name
;
}
public
String
getT
()
{
public
String
getT
ype
()
{
return
t
;
}
public
void
setT
(
String
t
)
{
public
void
setT
ype
(
String
t
)
{
this
.
t
=
t
;
}
...
...
@@ -98,19 +98,19 @@ public class RoomSubscription extends RealmObject {
this
.
unread
=
unread
;
}
public
long
get
_u
pdatedAt
()
{
public
long
get
U
pdatedAt
()
{
return
_updatedAt
;
}
public
void
set
_u
pdatedAt
(
long
_updatedAt
)
{
public
void
set
U
pdatedAt
(
long
_updatedAt
)
{
this
.
_updatedAt
=
_updatedAt
;
}
public
long
getL
s
()
{
public
long
getL
astSeen
()
{
return
ls
;
}
public
void
setL
s
(
long
ls
)
{
public
void
setL
astSeen
(
long
ls
)
{
this
.
ls
=
ls
;
}
}
app/src/main/java/chat/rocket/android/model/ddp/User.java
View file @
fe166ecf
...
...
@@ -27,11 +27,11 @@ public class User extends RealmObject {
return
realm
.
where
(
User
.
class
).
isNotEmpty
(
"emails"
);
}
public
String
get
_i
d
()
{
public
String
get
I
d
()
{
return
_id
;
}
public
void
set
_i
d
(
String
_id
)
{
public
void
set
I
d
(
String
_id
)
{
this
.
_id
=
_id
;
}
...
...
app/src/main/java/chat/rocket/android/model/internal/FileUploading.java
View file @
fe166ecf
...
...
@@ -31,11 +31,11 @@ public class FileUploading extends RealmObject {
this
.
uplId
=
uplId
;
}
public
int
getSync
s
tate
()
{
public
int
getSync
S
tate
()
{
return
syncstate
;
}
public
void
setSync
s
tate
(
int
syncstate
)
{
public
void
setSync
S
tate
(
int
syncstate
)
{
this
.
syncstate
=
syncstate
;
}
...
...
app/src/main/java/chat/rocket/android/model/internal/GetUsersOfRoomsProcedure.java
View file @
fe166ecf
...
...
@@ -22,11 +22,11 @@ public class GetUsersOfRoomsProcedure extends RealmObject {
this
.
roomId
=
roomId
;
}
public
int
getSync
s
tate
()
{
public
int
getSync
S
tate
()
{
return
syncstate
;
}
public
void
setSync
s
tate
(
int
syncstate
)
{
public
void
setSync
S
tate
(
int
syncstate
)
{
this
.
syncstate
=
syncstate
;
}
...
...
app/src/main/java/chat/rocket/android/model/internal/LoadMessageProcedure.java
View file @
fe166ecf
...
...
@@ -24,11 +24,11 @@ public class LoadMessageProcedure extends RealmObject {
this
.
roomId
=
roomId
;
}
public
int
getSync
s
tate
()
{
public
int
getSync
S
tate
()
{
return
syncstate
;
}
public
void
setSync
s
tate
(
int
syncstate
)
{
public
void
setSync
S
tate
(
int
syncstate
)
{
this
.
syncstate
=
syncstate
;
}
...
...
@@ -56,7 +56,7 @@ public class LoadMessageProcedure extends RealmObject {
this
.
count
=
count
;
}
public
boolean
isH
asNext
()
{
public
boolean
h
asNext
()
{
return
hasNext
;
}
...
...
app/src/main/java/chat/rocket/android/model/internal/MethodCall.java
View file @
fe166ecf
...
...
@@ -52,7 +52,7 @@ public class MethodCall extends RealmObject {
realmHelper
.
createObjectObserver
(
realm
->
realm
.
where
(
MethodCall
.
class
).
equalTo
(
"methodCallId"
,
newId
));
observer
.
setOnUpdateListener
(
methodCall
->
{
int
syncstate
=
methodCall
.
getSync
s
tate
();
int
syncstate
=
methodCall
.
getSync
S
tate
();
RCLog
.
d
(
"MethodCall[%s] syncstate=%d"
,
methodCall
.
getMethodCallId
(),
syncstate
);
if
(
syncstate
==
SyncState
.
SYNCED
)
{
String
resultJson
=
methodCall
.
getResultJson
();
...
...
@@ -102,11 +102,11 @@ public class MethodCall extends RealmObject {
this
.
methodCallId
=
methodCallId
;
}
public
int
getSync
s
tate
()
{
public
int
getSync
S
tate
()
{
return
syncstate
;
}
public
void
setSync
s
tate
(
int
syncstate
)
{
public
void
setSync
S
tate
(
int
syncstate
)
{
this
.
syncstate
=
syncstate
;
}
...
...
app/src/main/java/chat/rocket/android/renderer/MessageRenderer.java
View file @
fe166ecf
...
...
@@ -23,14 +23,14 @@ public class MessageRenderer extends AbstractRenderer<Message> {
public
MessageRenderer
(
Context
context
,
Message
message
)
{
super
(
context
,
message
);
userRenderer
=
new
UserRenderer
(
context
,
message
.
getU
());
userRenderer
=
new
UserRenderer
(
context
,
message
.
getU
ser
());
}
/**
* show Avatar image.
*/
public
MessageRenderer
avatarInto
(
ImageView
imageView
,
String
hostname
)
{
switch
(
object
.
getSync
s
tate
())
{
switch
(
object
.
getSync
S
tate
())
{
case
SyncState
.
FAILED
:
imageView
.
setImageResource
(
R
.
drawable
.
ic_error_outline_black_24dp
);
break
;
...
...
@@ -57,13 +57,13 @@ public class MessageRenderer extends AbstractRenderer<Message> {
return
this
;
}
switch
(
object
.
getSync
s
tate
())
{
switch
(
object
.
getSync
S
tate
())
{
case
SyncState
.
NOT_SYNCED
:
case
SyncState
.
SYNCING
:
textView
.
setText
(
R
.
string
.
sending
);
break
;
default
:
textView
.
setText
(
DateTime
.
fromEpocMs
(
object
.
getT
s
(),
DateTime
.
Format
.
TIME
));
textView
.
setText
(
DateTime
.
fromEpocMs
(
object
.
getT
imestamp
(),
DateTime
.
Format
.
TIME
));
break
;
}
...
...
@@ -78,7 +78,7 @@ public class MessageRenderer extends AbstractRenderer<Message> {
return
this
;
}
rocketChatMessageLayout
.
setText
(
object
.
getM
sg
());
rocketChatMessageLayout
.
setText
(
object
.
getM
essage
());
return
this
;
}
...
...
app/src/main/java/chat/rocket/android/service/observer/CurrentUserObserver.java
View file @
fe166ecf
...
...
@@ -56,7 +56,7 @@ public class CurrentUserObserver extends AbstractModelObserver<User> {
}
listeners
=
new
ArrayList
<>();
final
String
userId
=
user
.
get
_i
d
();
final
String
userId
=
user
.
get
I
d
();
// get and observe Room subscriptions.
methodCall
.
getRoomSubscriptions
().
onSuccess
(
task
->
{
...
...
app/src/main/java/chat/rocket/android/service/observer/FileUploadingToS3Observer.java
View file @
fe166ecf
...
...
@@ -46,7 +46,7 @@ public class FileUploadingToS3Observer extends AbstractModelObserver<FileUploadi
.
equalTo
(
"storageType"
,
FileUploading
.
STORAGE_TYPE_S3
)
.
findAll
();
for
(
FileUploading
req
:
pendingUploadRequests
)
{
req
.
setSync
s
tate
(
SyncState
.
NOT_SYNCED
);
req
.
setSync
S
tate
(
SyncState
.
NOT_SYNCED
);
}
// clean up records.
...
...
app/src/main/java/chat/rocket/android/service/observer/FileUploadingWithUfsObserver.java
View file @
fe166ecf
...
...
@@ -46,7 +46,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo
.
endGroup
()
.
findAll
();
for
(
FileUploading
req
:
pendingUploadRequests
)
{
req
.
setSync
s
tate
(
SyncState
.
NOT_SYNCED
);
req
.
setSync
S
tate
(
SyncState
.
NOT_SYNCED
);
}
// clean up records.
...
...
@@ -99,7 +99,7 @@ public class FileUploadingWithUfsObserver extends AbstractModelObserver<FileUplo
return
;
}
final
String
cookie
=
String
.
format
(
"rc_uid=%s; rc_token=%s"
,
currentUser
.
get
_i
d
(),
session
.
getToken
());
currentUser
.
get
I
d
(),
session
.
getToken
());
FileUploading
fileUploading
=
results
.
get
(
0
);
final
String
roomId
=
fileUploading
.
getRoomId
();
...
...
app/src/main/java/chat/rocket/android/service/observer/LoadMessageProcedureObserver.java
View file @
fe166ecf
...
...
@@ -61,7 +61,7 @@ public class LoadMessageProcedureObserver extends AbstractModelObserver<LoadMess
.
equalTo
(
"rid"
,
roomId
)
.
equalTo
(
"syncstate"
,
SyncState
.
SYNCED
)
.
findAllSorted
(
"ts"
,
Sort
.
ASCENDING
).
first
(
null
));
long
lastTs
=
lastMessage
!=
null
?
lastMessage
.
getT
s
()
:
0
;
long
lastTs
=
lastMessage
!=
null
?
lastMessage
.
getT
imestamp
()
:
0
;
int
messageCount
=
_task
.
getResult
().
length
();
return
realmHelper
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
LoadMessageProcedure
.
class
,
new
JSONObject
()
...
...
app/src/main/java/chat/rocket/android/service/observer/MethodCallObserver.java
View file @
fe166ecf
...
...
@@ -33,7 +33,7 @@ public class MethodCallObserver extends AbstractModelObserver<MethodCall> {
.
equalTo
(
"syncstate"
,
SyncState
.
SYNCING
)
.
findAll
();
for
(
MethodCall
call
:
pendingMethodCalls
)
{
call
.
setSync
s
tate
(
SyncState
.
NOT_SYNCED
);
call
.
setSync
S
tate
(
SyncState
.
NOT_SYNCED
);
}
// clean up records.
...
...
app/src/main/java/chat/rocket/android/service/observer/NewMessageObserver.java
View file @
fe166ecf
...
...
@@ -32,7 +32,7 @@ public class NewMessageObserver extends AbstractModelObserver<Message> {
.
equalTo
(
"syncstate"
,
SyncState
.
SYNCING
)
.
findAll
();
for
(
Message
message
:
pendingMethodCalls
)
{
message
.
setSync
s
tate
(
SyncState
.
NOT_SYNCED
);
message
.
setSync
S
tate
(
SyncState
.
NOT_SYNCED
);
}
return
null
;
...
...
@@ -54,9 +54,9 @@ public class NewMessageObserver extends AbstractModelObserver<Message> {
}
Message
message
=
results
.
get
(
0
);
final
String
messageId
=
message
.
get
_i
d
();
final
String
roomId
=
message
.
getR
i
d
();
final
String
msg
=
message
.
getM
sg
();
final
String
messageId
=
message
.
get
I
d
();
final
String
roomId
=
message
.
getR
oomI
d
();
final
String
msg
=
message
.
getM
essage
();
realmHelper
.
executeTransaction
(
realm
->
realm
.
createOrUpdateObjectFromJson
(
Message
.
class
,
new
JSONObject
()
...
...
app/src/main/java/chat/rocket/android/service/observer/ReactiveNotificationManager.java
View file @
fe166ecf
...
...
@@ -35,21 +35,21 @@ public class ReactiveNotificationManager extends AbstractModelObserver<RoomSubsc
public
void
onUpdateResults
(
List
<
RoomSubscription
>
roomSubscriptions
)
{
JSONArray
notifications
=
new
JSONArray
();
for
(
RoomSubscription
roomSubscription
:
roomSubscriptions
)
{
final
String
roomId
=
roomSubscription
.
getR
i
d
();
final
String
roomId
=
roomSubscription
.
getR
oomI
d
();
NotificationItem
item
=
realmHelper
.
executeTransactionForRead
(
realm
->
realm
.
where
(
NotificationItem
.
class
).
equalTo
(
"roomId"
,
roomId
).
findFirst
());
long
lastSeenAt
=
Math
.
max
(
item
!=
null
?
item
.
getLastSeenAt
()
:
0
,
roomSubscription
.
getL
s
());
long
lastSeenAt
=
Math
.
max
(
item
!=
null
?
item
.
getLastSeenAt
()
:
0
,
roomSubscription
.
getL
astSeen
());
try
{
JSONObject
notification
=
new
JSONObject
()
.
put
(
"roomId"
,
roomSubscription
.
getR
i
d
())
.
put
(
"roomId"
,
roomSubscription
.
getR
oomI
d
())
.
put
(
"title"
,
roomSubscription
.
getName
())
.
put
(
"description"
,
"new message"
)
.
put
(
"unreadCount"
,
roomSubscription
.
getUnread
())
.
put
(
"contentUpdatedAt"
,
roomSubscription
.
get
_u
pdatedAt
())
.
put
(
"contentUpdatedAt"
,
roomSubscription
.
get
U
pdatedAt
())
.
put
(
"lastSeenAt"
,
lastSeenAt
);
if
(
RoomSubscription
.
TYPE_DIRECT_MESSAGE
.
equals
(
roomSubscription
.
getT
()))
{
if
(
RoomSubscription
.
TYPE_DIRECT_MESSAGE
.
equals
(
roomSubscription
.
getT
ype
()))
{
notification
.
put
(
"senderName"
,
roomSubscription
.
getName
());
}
else
{
notification
.
put
(
"senderName"
,
JSONObject
.
NULL
);
...
...
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