aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/ui/ManageAccountActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-13 21:37:27 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-13 21:37:27 +0100
commit9c811f8fb20b056ea12803e93e5ea20dc052bdcd (patch)
tree7c4be8327ca3722f41d7784c126081a92585c26c /src/eu/siacs/conversations/ui/ManageAccountActivity.java
parent507cfba6ad481b078528ead056088e6aa6c4a3fc (diff)
sharing text
Diffstat (limited to 'src/eu/siacs/conversations/ui/ManageAccountActivity.java')
-rw-r--r--src/eu/siacs/conversations/ui/ManageAccountActivity.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
index 0d3adc85..22f7c78f 100644
--- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
@@ -289,6 +289,8 @@ public class ManageAccountActivity extends XmppActivity {
XmppConnection xmpp = selectedAccountForActionMode.getXmppConnection();
long connectionAge = (SystemClock.elapsedRealtime() - xmpp.lastConnect) / 60000;
long sessionAge = (SystemClock.elapsedRealtime() - xmpp.lastSessionStarted) / 60000;
+ long connectionAgeHours = connectionAge / 60;
+ long sessionAgeHours = sessionAge / 60;
View view = (View) getLayoutInflater().inflate(R.layout.server_info, null);
TextView connection = (TextView) view.findViewById(R.id.connection);
TextView session = (TextView) view.findViewById(R.id.session);
@@ -299,13 +301,21 @@ public class ManageAccountActivity extends XmppActivity {
TextView roster = (TextView) view.findViewById(R.id.roster);
pcks_received.setText(""+xmpp.getReceivedStanzas());
pcks_sent.setText(""+xmpp.getSentStanzas());
- connection.setText(connectionAge+" mins");
+ if (connectionAgeHours >= 2) {
+ connection.setText(connectionAgeHours+" hours");
+ } else {
+ connection.setText(connectionAge+" mins");
+ }
if (xmpp.hasFeatureStreamManagment()) {
- session.setText(sessionAge+" mins");
+ if (sessionAgeHours >= 2) {
+ session.setText(sessionAgeHours+" hours");
+ } else {
+ session.setText(sessionAge+" mins");
+ }
stream.setText("Yes");
} else {
stream.setText("No");
- session.setText(connectionAge+" mins");
+ session.setText(connection.getText());
}
if (xmpp.hasFeaturesCarbon()) {
carbon.setText("Yes");