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
0a694b50
Commit
0a694b50
authored
Nov 10, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix login is called many times.
parent
e387dbcf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
GitHubOAuthFragment.java
...at/rocket/android/fragment/oauth/GitHubOAuthFragment.java
+1
-1
LoginFragment.java
.../rocket/android/fragment/server_config/LoginFragment.java
+1
-1
MeteorLoginServiceConfiguration.java
...rocket/android/model/MeteorLoginServiceConfiguration.java
+5
-5
AbstractDDPDocEventSubscriber.java
...service/ddp_subscriber/AbstractDDPDocEventSubscriber.java
+2
-2
No files found.
app/src/main/java/chat/rocket/android/fragment/oauth/GitHubOAuthFragment.java
View file @
0a694b50
...
@@ -55,7 +55,7 @@ public class GitHubOAuthFragment extends AbstractWebViewFragment {
...
@@ -55,7 +55,7 @@ public class GitHubOAuthFragment extends AbstractWebViewFragment {
MeteorLoginServiceConfiguration
oauthConfig
=
RealmHelper
.
executeTransactionForRead
(
realm
->
MeteorLoginServiceConfiguration
oauthConfig
=
RealmHelper
.
executeTransactionForRead
(
realm
->
realm
.
where
(
MeteorLoginServiceConfiguration
.
class
)
realm
.
where
(
MeteorLoginServiceConfiguration
.
class
)
.
equalTo
(
"service"
,
"github"
)
.
equalTo
(
"service"
,
"github"
)
.
equalTo
(
"serverConfig
.i
d"
,
serverConfigId
)
.
equalTo
(
"serverConfig
I
d"
,
serverConfigId
)
.
findFirst
());
.
findFirst
());
if
(
serverConfig
==
null
||
oauthConfig
==
null
)
{
if
(
serverConfig
==
null
||
oauthConfig
==
null
)
{
throw
new
IllegalArgumentException
(
throw
new
IllegalArgumentException
(
...
...
app/src/main/java/chat/rocket/android/fragment/server_config/LoginFragment.java
View file @
0a694b50
...
@@ -25,7 +25,7 @@ public class LoginFragment extends AbstractServerConfigFragment {
...
@@ -25,7 +25,7 @@ public class LoginFragment extends AbstractServerConfigFragment {
new
RealmListObserver
<
MeteorLoginServiceConfiguration
>()
{
new
RealmListObserver
<
MeteorLoginServiceConfiguration
>()
{
@Override
protected
RealmResults
<
MeteorLoginServiceConfiguration
>
queryItems
(
Realm
realm
)
{
@Override
protected
RealmResults
<
MeteorLoginServiceConfiguration
>
queryItems
(
Realm
realm
)
{
return
realm
.
where
(
MeteorLoginServiceConfiguration
.
class
)
return
realm
.
where
(
MeteorLoginServiceConfiguration
.
class
)
.
equalTo
(
"serverConfig
.i
d"
,
serverConfigId
)
.
equalTo
(
"serverConfig
I
d"
,
serverConfigId
)
.
findAll
();
.
findAll
();
}
}
...
...
app/src/main/java/chat/rocket/android/model/MeteorLoginServiceConfiguration.java
View file @
0a694b50
...
@@ -10,7 +10,7 @@ import io.realm.annotations.PrimaryKey;
...
@@ -10,7 +10,7 @@ import io.realm.annotations.PrimaryKey;
public
class
MeteorLoginServiceConfiguration
public
class
MeteorLoginServiceConfiguration
extends
RealmObject
{
extends
RealmObject
{
@PrimaryKey
private
String
id
;
@PrimaryKey
private
String
id
;
private
S
erverConfig
serverConfig
;
private
S
tring
serverConfigId
;
private
String
service
;
private
String
service
;
private
String
consumerKey
;
//for Twitter
private
String
consumerKey
;
//for Twitter
private
String
appId
;
//for Facebook
private
String
appId
;
//for Facebook
...
@@ -24,12 +24,12 @@ public class MeteorLoginServiceConfiguration
...
@@ -24,12 +24,12 @@ public class MeteorLoginServiceConfiguration
this
.
id
=
id
;
this
.
id
=
id
;
}
}
public
S
erverConfig
getServerConfig
()
{
public
S
tring
getServerConfigId
()
{
return
serverConfig
;
return
serverConfig
Id
;
}
}
public
void
setServerConfig
(
ServerConfig
serverConfig
)
{
public
void
setServerConfig
Id
(
String
serverConfigId
)
{
this
.
serverConfig
=
serverConfig
;
this
.
serverConfig
Id
=
serverConfigId
;
}
}
public
String
getService
()
{
public
String
getService
()
{
...
...
app/src/main/java/chat/rocket/android/service/ddp_subscriber/AbstractDDPDocEventSubscriber.java
View file @
0a694b50
...
@@ -93,7 +93,7 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
...
@@ -93,7 +93,7 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
private
void
onDocumentAdded
(
Realm
realm
,
DDPSubscription
.
Added
docEvent
)
throws
JSONException
{
private
void
onDocumentAdded
(
Realm
realm
,
DDPSubscription
.
Added
docEvent
)
throws
JSONException
{
//executed in RealmTransaction
//executed in RealmTransaction
JSONObject
json
=
new
JSONObject
().
put
(
"id"
,
docEvent
.
docID
);
JSONObject
json
=
new
JSONObject
().
put
(
"id"
,
docEvent
.
docID
);
json
.
put
(
"serverConfig
"
,
new
JSONObject
().
put
(
"id"
,
serverConfigId
)
);
json
.
put
(
"serverConfig
Id"
,
serverConfigId
);
mergeJson
(
json
,
docEvent
.
fields
);
mergeJson
(
json
,
docEvent
.
fields
);
realm
.
createOrUpdateObjectFromJson
(
getModelClass
(),
customizeFieldJson
(
json
));
realm
.
createOrUpdateObjectFromJson
(
getModelClass
(),
customizeFieldJson
(
json
));
}
}
...
@@ -109,7 +109,7 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
...
@@ -109,7 +109,7 @@ abstract class AbstractDDPDocEventSubscriber implements Registerable {
throws
JSONException
{
throws
JSONException
{
//executed in RealmTransaction
//executed in RealmTransaction
JSONObject
json
=
new
JSONObject
().
put
(
"id"
,
docEvent
.
docID
);
JSONObject
json
=
new
JSONObject
().
put
(
"id"
,
docEvent
.
docID
);
json
.
put
(
"serverConfig
"
,
new
JSONObject
().
put
(
"id"
,
serverConfigId
)
);
json
.
put
(
"serverConfig
Id"
,
serverConfigId
);
for
(
int
i
=
0
;
i
<
docEvent
.
cleared
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
docEvent
.
cleared
.
length
();
i
++)
{
String
fieldToDelete
=
docEvent
.
cleared
.
getString
(
i
);
String
fieldToDelete
=
docEvent
.
cleared
.
getString
(
i
);
json
.
put
(
fieldToDelete
,
JSONObject
.
NULL
);
json
.
put
(
fieldToDelete
,
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