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
f09d5d35
Commit
f09d5d35
authored
Oct 14, 2017
by
Filipe de Lima Brito
Committed by
GitHub
Oct 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #526 from estevanfick/develop
[FIX] Missing name field in Realm database.
parents
7d8390a7
1264e85d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
20 deletions
+36
-20
RealmUser.java
...a/chat/rocket/persistence/realm/models/ddp/RealmUser.java
+36
-20
No files found.
persistence-realm/src/main/java/chat/rocket/persistence/realm/models/ddp/RealmUser.java
View file @
f09d5d35
package
chat
.
rocket
.
persistence
.
realm
.
models
.
ddp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.core.models.Email
;
import
chat.rocket.core.models.User
;
import
io.realm.Realm
;
import
io.realm.RealmList
;
import
io.realm.RealmObject
;
import
io.realm.RealmQuery
;
import
io.realm.annotations.PrimaryKey
;
import
java.util.ArrayList
;
import
java.util.List
;
import
chat.rocket.core.models.Email
;
import
chat.rocket.core.models.User
;
/**
* RealmUser.
*/
...
...
@@ -19,6 +19,7 @@ import chat.rocket.core.models.User;
public
class
RealmUser
extends
RealmObject
{
public
static
final
String
ID
=
"_id"
;
public
static
final
String
NAME
=
"name"
;
public
static
final
String
USERNAME
=
"username"
;
public
static
final
String
STATUS
=
"status"
;
public
static
final
String
UTC_OFFSET
=
"utcOffset"
;
...
...
@@ -31,6 +32,7 @@ public class RealmUser extends RealmObject {
public
static
final
String
STATUS_OFFLINE
=
"offline"
;
@PrimaryKey
private
String
_id
;
private
String
name
;
private
String
username
;
private
String
status
;
private
double
utcOffset
;
...
...
@@ -57,6 +59,14 @@ public class RealmUser extends RealmObject {
this
.
username
=
username
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getStatus
()
{
return
status
;
}
...
...
@@ -96,6 +106,7 @@ public class RealmUser extends RealmObject {
return
User
.
builder
()
.
setId
(
_id
)
.
setName
(
name
)
.
setUsername
(
username
)
.
setStatus
(
status
)
.
setUtcOffset
(
utcOffset
)
...
...
@@ -108,6 +119,7 @@ public class RealmUser extends RealmObject {
public
String
toString
()
{
return
"RealmUser{"
+
"_id='"
+
_id
+
'\''
+
", name='"
+
name
+
'\''
+
", username='"
+
username
+
'\''
+
", status='"
+
status
+
'\''
+
", utcOffset="
+
utcOffset
+
...
...
@@ -133,6 +145,9 @@ public class RealmUser extends RealmObject {
if
(
_id
!=
null
?
!
_id
.
equals
(
user
.
_id
)
:
user
.
_id
!=
null
)
{
return
false
;
}
if
(
name
!=
null
?
!
name
.
equals
(
user
.
name
)
:
user
.
name
!=
null
)
{
return
false
;
}
if
(
username
!=
null
?
!
username
.
equals
(
user
.
username
)
:
user
.
username
!=
null
)
{
return
false
;
}
...
...
@@ -151,6 +166,7 @@ public class RealmUser extends RealmObject {
int
result
;
long
temp
;
result
=
_id
!=
null
?
_id
.
hashCode
()
:
0
;
result
=
31
*
result
+
(
name
!=
null
?
name
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
username
!=
null
?
username
.
hashCode
()
:
0
);
result
=
31
*
result
+
(
status
!=
null
?
status
.
hashCode
()
:
0
);
temp
=
Double
.
doubleToLongBits
(
utcOffset
);
...
...
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