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
2bff1ec8
Commit
2bff1ec8
authored
Nov 22, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump Realm version to 4.2.0, remove RxJavaInterop library
parent
0d0e4556
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
45 additions
and
62 deletions
+45
-62
build.gradle
app/build.gradle
+1
-2
build.gradle
build.gradle
+1
-1
RealmStore.java
...c/main/java/chat/rocket/persistence/realm/RealmStore.java
+0
-3
RealmLoginServiceConfigurationRepository.java
...epositories/RealmLoginServiceConfigurationRepository.java
+4
-5
RealmMessageRepository.java
...ersistence/realm/repositories/RealmMessageRepository.java
+8
-9
RealmPermissionRepository.java
...istence/realm/repositories/RealmPermissionRepository.java
+2
-3
RealmPublicSettingRepository.java
...ence/realm/repositories/RealmPublicSettingRepository.java
+2
-3
RealmRoomRepository.java
...t/persistence/realm/repositories/RealmRoomRepository.java
+8
-9
RealmRoomRoleRepository.java
...rsistence/realm/repositories/RealmRoomRoleRepository.java
+2
-3
RealmServerInfoRepository.java
...istence/realm/repositories/RealmServerInfoRepository.java
+1
-2
RealmSessionRepository.java
...ersistence/realm/repositories/RealmSessionRepository.java
+2
-3
RealmSpotlightRepository.kt
...ersistence/realm/repositories/RealmSpotlightRepository.kt
+2
-3
RealmSpotlightRoomRepository.java
...ence/realm/repositories/RealmSpotlightRoomRepository.java
+2
-3
RealmSpotlightUserRepository.java
...ence/realm/repositories/RealmSpotlightUserRepository.java
+2
-3
RealmUserRepository.java
...t/persistence/realm/repositories/RealmUserRepository.java
+7
-8
build.gradle
rocket-chat-core/build.gradle
+1
-2
No files found.
app/build.gradle
View file @
2bff1ec8
...
...
@@ -120,7 +120,6 @@ dependencies {
compile
rxbindingDependencies
.
rxBinding
compile
rxbindingDependencies
.
rxBindingSupport
compile
rxbindingDependencies
.
rxBindingAppcompact
compile
"com.github.akarnokd:rxjava2-interop:0.11.0"
compile
"org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
compile
"com.google.firebase:firebase-core:$playLibVersion"
compile
"com.google.firebase:firebase-crash:$playLibVersion"
...
...
@@ -145,7 +144,7 @@ dependencies {
testCompile
"org.jetbrains.kotlin:kotlin-test:$rootProject.ext.kotlinVersion"
testCompile
"org.jetbrains.kotlin:kotlin-test-junit:$rootProject.ext.kotlinVersion"
testCompile
"org.jetbrains.kotlin:kotlin-reflect:$rootProject.ext.kotlinVersion"
testCompile
"com.nhaarman:mockito-kotlin:1.
1
.0"
testCompile
"com.nhaarman:mockito-kotlin:1.
5
.0"
testCompile
'org.amshove.kluent:kluent:1.14'
}
apply
plugin:
'com.google.gms.google-services'
build.gradle
View file @
2bff1ec8
...
...
@@ -17,7 +17,7 @@ buildscript {
dependencies
{
classpath
'com.android.tools.build:gradle:3.0.1'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.60"
classpath
'io.realm:realm-gradle-plugin:
2.3.2
'
classpath
'io.realm:realm-gradle-plugin:
4.2.0
'
classpath
'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath
'com.google.gms:google-services:3.0.0'
classpath
'com.github.triplet.gradle:play-publisher:1.1.5'
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/RealmStore.java
View file @
2bff1ec8
...
...
@@ -16,8 +16,6 @@ public class RealmStore {
.
modules
(
new
RocketChatLibraryModule
())
.
migration
(
new
Migration
())
.
schemaVersion
(
6
)
// Just in case
.
deleteRealmIfMigrationNeeded
()
.
build
();
}
...
...
@@ -49,7 +47,6 @@ public class RealmStore {
sStore
.
put
(
name
,
new
RealmConfiguration
.
Builder
()
.
name
(
name
+
".realm"
)
.
modules
(
new
RocketChatServerModule
())
.
deleteRealmIfMigrationNeeded
()
.
build
());
}
return
new
RealmHelper
(
sStore
.
get
(
name
));
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmLoginServiceConfigurationRepository.java
View file @
2bff1ec8
...
...
@@ -12,7 +12,6 @@ import chat.rocket.core.models.LoginServiceConfiguration;
import
chat.rocket.core.repositories.LoginServiceConfigurationRepository
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmMeteorLoginServiceConfiguration
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -36,10 +35,10 @@ public class RealmLoginServiceConfigurationRepository extends RealmRepository
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmMeteorLoginServiceConfiguration
.
class
)
return
pair
.
first
.
where
(
RealmMeteorLoginServiceConfiguration
.
class
)
.
equalTo
(
RealmMeteorLoginServiceConfiguration
.
SERVICE
,
serviceName
)
.
findAll
()
.<
RealmResults
<
RealmMeteorLoginServiceConfiguration
>>
as
Observable
()
);
.<
RealmResults
<
RealmMeteorLoginServiceConfiguration
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
@@ -58,9 +57,9 @@ public class RealmLoginServiceConfigurationRepository extends RealmRepository
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmMeteorLoginServiceConfiguration
.
class
)
return
pair
.
first
.
where
(
RealmMeteorLoginServiceConfiguration
.
class
)
.
findAll
()
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmMessageRepository.java
View file @
2bff1ec8
...
...
@@ -17,7 +17,6 @@ import chat.rocket.persistence.realm.RealmHelper;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmMessage
;
import
chat.rocket.persistence.realm.models.ddp.RealmUser
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -42,10 +41,10 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmMessage
.
class
)
return
pair
.
first
.
where
(
RealmMessage
.
class
)
.
equalTo
(
RealmMessage
.
ID
,
messageId
)
.
findAll
()
.<
RealmResults
<
RealmMessage
>>
as
Observable
()
);
.<
RealmResults
<
RealmMessage
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
@@ -112,10 +111,10 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
realm
.
beginTransaction
();
return
RxJavaInterop
.
toV2Flowable
(
realm
.
where
(
RealmMessage
.
class
)
return
realm
.
where
(
RealmMessage
.
class
)
.
equalTo
(
RealmMessage
.
ID
,
message
.
getId
())
.
findAll
()
.<
RealmResults
<
RealmMessage
>>
as
Observable
()
)
.<
RealmResults
<
RealmMessage
>>
as
Flowable
(
)
.
filter
(
realmObject
->
realmObject
.
isLoaded
()
&&
realmObject
.
isValid
())
.
firstElement
()
.
toSingle
()
...
...
@@ -140,13 +139,13 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmMessage
.
class
)
return
pair
.
first
.
where
(
RealmMessage
.
class
)
.
notEqualTo
(
RealmMessage
.
SYNC_STATE
,
SyncState
.
DELETE_NOT_SYNCED
)
.
notEqualTo
(
RealmMessage
.
SYNC_STATE
,
SyncState
.
DELETING
)
.
equalTo
(
RealmMessage
.
ROOM_ID
,
room
.
getRoomId
())
.
isNotNull
(
RealmMessage
.
USER
)
.
findAllSorted
(
RealmMessage
.
TIMESTAMP
,
Sort
.
DESCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
@@ -165,12 +164,12 @@ public class RealmMessageRepository extends RealmRepository implements MessageRe
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmMessage
.
class
)
return
pair
.
first
.
where
(
RealmMessage
.
class
)
.
equalTo
(
RealmMessage
.
ROOM_ID
,
room
.
getId
())
.
greaterThanOrEqualTo
(
RealmMessage
.
TIMESTAMP
,
room
.
getLastSeen
())
.
notEqualTo
(
RealmMessage
.
USER_ID
,
user
.
getId
())
.
findAll
()
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmPermissionRepository.java
View file @
2bff1ec8
...
...
@@ -9,7 +9,6 @@ import chat.rocket.core.models.Permission;
import
chat.rocket.core.repositories.PermissionRepository
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmPermission
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -31,10 +30,10 @@ public class RealmPermissionRepository extends RealmRepository implements Permis
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmPermission
.
class
)
return
pair
.
first
.
where
(
RealmPermission
.
class
)
.
equalTo
(
RealmPermission
.
Columns
.
ID
,
id
)
.
findAll
()
.<
RealmResults
<
RealmPermission
>>
as
Observable
()
);
.<
RealmResults
<
RealmPermission
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmPublicSettingRepository.java
View file @
2bff1ec8
...
...
@@ -9,7 +9,6 @@ import chat.rocket.core.models.PublicSetting;
import
chat.rocket.core.repositories.PublicSettingRepository
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmPublicSetting
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -32,10 +31,10 @@ public class RealmPublicSettingRepository extends RealmRepository
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmPublicSetting
.
class
)
return
pair
.
first
.
where
(
RealmPublicSetting
.
class
)
.
equalTo
(
RealmPublicSetting
.
ID
,
id
)
.
findAll
()
.<
RealmResults
<
RealmPublicSetting
>>
as
Observable
()
);
.<
RealmResults
<
RealmPublicSetting
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmRoomRepository.java
View file @
2bff1ec8
...
...
@@ -16,7 +16,6 @@ import chat.rocket.persistence.realm.RealmHelper;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmRoom
;
import
chat.rocket.persistence.realm.models.internal.LoadMessageProcedure
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -42,9 +41,9 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmRoom
.
class
)
return
pair
.
first
.
where
(
RealmRoom
.
class
)
.
findAll
()
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
@@ -71,7 +70,7 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
return
Flowable
.
just
(
Optional
.<
RealmRoom
>
absent
());
}
return
RxJavaInterop
.
toV2Flowable
(
realmRoom
.<
RealmRoom
>
asObservable
()
)
return
realmRoom
.<
RealmRoom
>
asFlowable
(
)
.
filter
(
roomSubscription
->
roomSubscription
.
isLoaded
()
&&
roomSubscription
.
isValid
())
...
...
@@ -106,7 +105,7 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
return
Flowable
.
just
(
Optional
.<
LoadMessageProcedure
>
absent
());
}
return
RxJavaInterop
.
toV2Flowable
(
messageProcedure
.<
LoadMessageProcedure
>
asObservable
()
)
return
messageProcedure
.<
LoadMessageProcedure
>
asFlowable
(
)
.
filter
(
loadMessageProcedure
->
loadMessageProcedure
.
isLoaded
()
&&
loadMessageProcedure
.
isValid
())
.
map
(
Optional:
:
of
);
...
...
@@ -157,7 +156,7 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmRoom
.
class
)
return
pair
.
first
.
where
(
RealmRoom
.
class
)
.
like
(
RealmRoom
.
NAME
,
"*"
+
name
+
"*"
,
Case
.
INSENSITIVE
)
.
beginGroup
()
.
equalTo
(
RealmRoom
.
TYPE
,
RealmRoom
.
TYPE_CHANNEL
)
...
...
@@ -166,7 +165,7 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
.
endGroup
()
.
findAllSorted
(
RealmRoom
.
NAME
,
direction
.
equals
(
SortDirection
.
ASC
)
?
Sort
.
ASCENDING
:
Sort
.
DESCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
@@ -184,14 +183,14 @@ public class RealmRoomRepository extends RealmRepository implements RoomReposito
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmRoom
.
class
)
return
pair
.
first
.
where
(
RealmRoom
.
class
)
.
beginGroup
()
.
equalTo
(
RealmRoom
.
TYPE
,
RealmRoom
.
TYPE_CHANNEL
)
.
or
()
.
equalTo
(
RealmRoom
.
TYPE
,
RealmRoom
.
TYPE_PRIVATE
)
.
endGroup
()
.
findAllSorted
(
RealmRoom
.
LAST_SEEN
,
Sort
.
ASCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmRoomRoleRepository.java
View file @
2bff1ec8
...
...
@@ -12,7 +12,6 @@ import chat.rocket.core.repositories.RoomRoleRepository;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmRoomRole
;
import
chat.rocket.persistence.realm.models.ddp.RealmUser
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -34,11 +33,11 @@ public class RealmRoomRoleRepository extends RealmRepository implements RoomRole
if
(
pair
.
first
==
null
)
{
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmRoomRole
.
class
)
return
pair
.
first
.
where
(
RealmRoomRole
.
class
)
.
equalTo
(
RealmRoomRole
.
Columns
.
ROOM_ID
,
room
.
getId
())
.
equalTo
(
RealmRoomRole
.
Columns
.
USER
+
"."
+
RealmUser
.
ID
,
user
.
getId
())
.
findAll
()
.<
RealmResults
<
RealmRoomRole
>>
as
Observable
()
);
.<
RealmResults
<
RealmRoomRole
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmServerInfoRepository.java
View file @
2bff1ec8
...
...
@@ -8,7 +8,6 @@ import com.hadisatrio.optional.Optional;
import
chat.rocket.core.models.ServerInfo
;
import
chat.rocket.core.repositories.ServerInfoRepository
;
import
chat.rocket.persistence.realm.models.RealmBasedServerInfo
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -27,7 +26,7 @@ public class RealmServerInfoRepository extends RealmRepository implements Server
return
Flowable
.
just
(
Optional
.<
RealmBasedServerInfo
>
absent
());
}
return
RxJavaInterop
.
toV2Flowable
(
info
.<
RealmBasedServerInfo
>
asObservable
()
)
return
info
.<
RealmBasedServerInfo
>
asFlowable
(
)
.
filter
(
it
->
it
.
isLoaded
()
&&
it
.
isValid
())
.
map
(
Optional:
:
of
);
},
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmSessionRepository.java
View file @
2bff1ec8
...
...
@@ -10,7 +10,6 @@ import chat.rocket.core.repositories.SessionRepository;
import
chat.rocket.persistence.realm.RealmHelper
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.internal.RealmSession
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.Single
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
...
...
@@ -33,10 +32,10 @@ public class RealmSessionRepository extends RealmRepository implements SessionRe
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmSession
.
class
)
return
pair
.
first
.
where
(
RealmSession
.
class
)
.
equalTo
(
RealmSession
.
ID
,
id
)
.
findAll
()
.<
RealmSession
>
as
Observable
().
first
()
);
.<
RealmSession
>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmSpotlightRepository.kt
View file @
2bff1ec8
...
...
@@ -6,7 +6,6 @@ import chat.rocket.core.repositories.SpotlightRepository
import
chat.rocket.persistence.realm.RealmStore
import
chat.rocket.persistence.realm.models.ddp.RealmSpotlight
import
chat.rocket.persistence.realm.models.ddp.RealmSpotlight.Columns
import
hu.akarnokd.rxjava.interop.RxJavaInterop
import
io.reactivex.Flowable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.realm.Realm
...
...
@@ -24,9 +23,9 @@ class RealmSpotlightRepository(private val hostname: String) : RealmRepository()
return
@using
Flowable
.
empty
()
}
return
@using
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmSpotlight
::
class
.
java
)
return
@using
pair
.
first
.
where
(
RealmSpotlight
::
class
.
java
)
.
findAllSorted
(
Columns
.
TYPE
,
Sort
.
DESCENDING
)
.
as
Observable
()
)
.
as
Flowable
(
)
})
{
pair
->
close
(
pair
.
first
,
pair
.
second
)
}
.
unsubscribeOn
(
AndroidSchedulers
.
from
(
Looper
.
myLooper
()
!!
))
.
filter
{
realmSpotlightResults
->
realmSpotlightResults
.
isLoaded
&&
realmSpotlightResults
.
isValid
}
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmSpotlightRoomRepository.java
View file @
2bff1ec8
...
...
@@ -12,7 +12,6 @@ import chat.rocket.core.repositories.SpotlightRoomRepository;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmRoom
;
import
chat.rocket.persistence.realm.models.ddp.RealmSpotlightRoom
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.realm.Case
;
...
...
@@ -35,7 +34,7 @@ public class RealmSpotlightRoomRepository extends RealmRepository implements Spo
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmSpotlightRoom
.
class
)
return
pair
.
first
.
where
(
RealmSpotlightRoom
.
class
)
.
like
(
RealmSpotlightRoom
.
Columns
.
NAME
,
"*"
+
name
+
"*"
,
Case
.
INSENSITIVE
)
.
beginGroup
()
.
equalTo
(
RealmSpotlightRoom
.
Columns
.
TYPE
,
RealmRoom
.
TYPE_CHANNEL
)
...
...
@@ -43,7 +42,7 @@ public class RealmSpotlightRoomRepository extends RealmRepository implements Spo
.
equalTo
(
RealmSpotlightRoom
.
Columns
.
TYPE
,
RealmRoom
.
TYPE_PRIVATE
)
.
endGroup
()
.
findAllSorted
(
RealmSpotlightRoom
.
Columns
.
NAME
,
direction
.
equals
(
SortDirection
.
ASC
)
?
Sort
.
ASCENDING
:
Sort
.
DESCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmSpotlightUserRepository.java
View file @
2bff1ec8
...
...
@@ -11,7 +11,6 @@ import chat.rocket.core.models.SpotlightUser;
import
chat.rocket.core.repositories.SpotlightUserRepository
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmSpotlightUser
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.realm.Case
;
...
...
@@ -34,7 +33,7 @@ public class RealmSpotlightUserRepository extends RealmRepository implements Spo
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmSpotlightUser
.
class
)
return
pair
.
first
.
where
(
RealmSpotlightUser
.
class
)
.
beginGroup
()
.
like
(
RealmSpotlightUser
.
Columns
.
USERNAME
,
"*"
+
name
+
"*"
,
Case
.
INSENSITIVE
)
.
isNull
(
RealmSpotlightUser
.
Columns
.
NAME
)
...
...
@@ -46,7 +45,7 @@ public class RealmSpotlightUserRepository extends RealmRepository implements Spo
.
endGroup
()
.
findAllSorted
(
RealmSpotlightUser
.
Columns
.
USERNAME
,
direction
.
equals
(
SortDirection
.
ASC
)
?
Sort
.
ASCENDING
:
Sort
.
DESCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
)
)
...
...
persistence-realm/src/main/java/chat/rocket/persistence/realm/repositories/RealmUserRepository.java
View file @
2bff1ec8
...
...
@@ -12,7 +12,6 @@ import chat.rocket.core.models.User;
import
chat.rocket.core.repositories.UserRepository
;
import
chat.rocket.persistence.realm.RealmStore
;
import
chat.rocket.persistence.realm.models.ddp.RealmUser
;
import
hu.akarnokd.rxjava.interop.RxJavaInterop
;
import
io.reactivex.Flowable
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.realm.Case
;
...
...
@@ -36,9 +35,9 @@ public class RealmUserRepository extends RealmRepository implements UserReposito
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmUser
.
class
)
return
pair
.
first
.
where
(
RealmUser
.
class
)
.
findAll
()
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
))
.
unsubscribeOn
(
AndroidSchedulers
.
from
(
Looper
.
myLooper
()))
...
...
@@ -70,10 +69,10 @@ public class RealmUserRepository extends RealmRepository implements UserReposito
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmUser
.
class
)
return
pair
.
first
.
where
(
RealmUser
.
class
)
.
isNotEmpty
(
RealmUser
.
EMAILS
)
.
findAll
()
.<
RealmResults
<
RealmUser
>>
as
Observable
()
);
.<
RealmResults
<
RealmUser
>>
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
));
}
...
...
@@ -112,7 +111,7 @@ public class RealmUserRepository extends RealmRepository implements UserReposito
return
Flowable
.
just
(
Optional
.
absent
());
}
return
RxJavaInterop
.
toV2Flowable
(
realmUser
.<
RealmUser
>
asObservable
()
)
return
realmUser
.<
RealmUser
>
asFlowable
(
)
.
filter
(
user
->
user
.
isLoaded
()
&&
user
.
isValid
())
.
map
(
Optional:
:
of
);
}
...
...
@@ -135,10 +134,10 @@ public class RealmUserRepository extends RealmRepository implements UserReposito
return
Flowable
.
empty
();
}
return
RxJavaInterop
.
toV2Flowable
(
pair
.
first
.
where
(
RealmUser
.
class
)
return
pair
.
first
.
where
(
RealmUser
.
class
)
.
like
(
RealmUser
.
USERNAME
,
"*"
+
name
+
"*"
,
Case
.
INSENSITIVE
)
.
findAllSorted
(
RealmUser
.
USERNAME
,
Sort
.
DESCENDING
)
.
as
Observable
()
);
.
as
Flowable
(
);
},
pair
->
close
(
pair
.
first
,
pair
.
second
));
}
...
...
rocket-chat-core/build.gradle
View file @
2bff1ec8
...
...
@@ -5,9 +5,8 @@ apply plugin: 'java'
dependencies
{
compile
extraDependencies
.
rxJava
compile
extraDependencies
.
optional
compile
"com.github.akarnokd:rxjava2-interop:0.11.0"
compile
"org.jetbrains.kotlin:kotlin-stdlib-jre7:$rootProject.ext.kotlinVersion"
compile
'com.google.code.findbugs:jsr305:3.0.
1
'
compile
'com.google.code.findbugs:jsr305:3.0.
2
'
compileOnly
'com.google.auto.value:auto-value:1.3'
kapt
'com.google.auto.value:auto-value:1.3'
kapt
'com.gabrielittner.auto.value:auto-value-with:1.0.0'
...
...
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