Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
303dccc8
Commit
303dccc8
authored
Feb 06, 2013
by
Alexander Ivanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop OTR session on disable OTR in the settings. Fixes #98.
parent
783bdbbc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
SettingsManager.java
src/com/xabber/android/data/SettingsManager.java
+4
-0
OTRManager.java
src/com/xabber/android/data/extension/otr/OTRManager.java
+12
-3
No files found.
src/com/xabber/android/data/SettingsManager.java
View file @
303dccc8
...
@@ -32,6 +32,7 @@ import com.xabber.android.data.account.AccountManager;
...
@@ -32,6 +32,7 @@ import com.xabber.android.data.account.AccountManager;
import
com.xabber.android.data.account.StatusMode
;
import
com.xabber.android.data.account.StatusMode
;
import
com.xabber.android.data.connection.NetworkManager
;
import
com.xabber.android.data.connection.NetworkManager
;
import
com.xabber.android.data.extension.attention.AttentionManager
;
import
com.xabber.android.data.extension.attention.AttentionManager
;
import
com.xabber.android.data.extension.otr.OTRManager
;
import
com.xabber.android.data.message.MessageManager
;
import
com.xabber.android.data.message.MessageManager
;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.data.notification.NotificationManager
;
import
com.xabber.android.data.roster.AbstractContact
;
import
com.xabber.android.data.roster.AbstractContact
;
...
@@ -772,6 +773,9 @@ public class SettingsManager implements OnInitializedListener,
...
@@ -772,6 +773,9 @@ public class SettingsManager implements OnInitializedListener,
}
else
if
(
key
.
equals
(
Application
.
getInstance
().
getString
(
}
else
if
(
key
.
equals
(
Application
.
getInstance
().
getString
(
R
.
string
.
chats_attention_key
)))
{
R
.
string
.
chats_attention_key
)))
{
AttentionManager
.
getInstance
().
onSettingsChanged
();
AttentionManager
.
getInstance
().
onSettingsChanged
();
}
else
if
(
key
.
equals
(
Application
.
getInstance
().
getString
(
R
.
string
.
security_otr_mode_key
)))
{
OTRManager
.
getInstance
().
onSettingsChanged
();
}
}
}
}
...
...
src/com/xabber/android/data/extension/otr/OTRManager.java
View file @
303dccc8
...
@@ -691,16 +691,25 @@ public class OTRManager implements OtrEngineHost, OtrEngineListener,
...
@@ -691,16 +691,25 @@ public class OTRManager implements OtrEngineHost, OtrEngineListener,
});
});
}
}
@Override
private
void
endAllSessions
()
{
public
void
onClose
()
{
NestedMap
<
String
>
entities
=
new
NestedMap
<
String
>();
NestedMap
<
String
>
entities
=
new
NestedMap
<
String
>();
entities
.
addAll
(
actives
);
entities
.
addAll
(
actives
);
for
(
Entry
<
String
>
entry
:
entities
)
for
(
Entry
<
String
>
entry
:
entities
)
try
{
try
{
endSession
(
entry
.
getFirst
(),
entry
.
getSecond
());
endSession
(
entry
.
getFirst
(),
entry
.
getSecond
());
}
catch
(
NetworkException
e
)
{
}
catch
(
NetworkException
e
)
{
// Just ignore.
LogManager
.
exception
(
this
,
e
);
}
}
}
}
@Override
public
void
onClose
()
{
endAllSessions
();
}
public
void
onSettingsChanged
()
{
if
(
SettingsManager
.
securityOtrMode
()
==
SecurityOtrMode
.
disabled
)
endAllSessions
();
}
}
}
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