aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/layout/server_info.xml20
-rw-r--r--res/layout/share_with.xml4
-rw-r--r--res/values-es/strings.xml21
-rw-r--r--res/values/strings.xml20
-rw-r--r--src/eu/siacs/conversations/crypto/PgpEngine.java10
-rw-r--r--src/eu/siacs/conversations/entities/Conversation.java2
-rw-r--r--src/eu/siacs/conversations/entities/MucOptions.java45
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java17
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java14
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java8
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java64
-rw-r--r--src/eu/siacs/conversations/ui/ManageAccountActivity.java24
-rw-r--r--src/eu/siacs/conversations/ui/MucDetailsActivity.java8
-rw-r--r--src/eu/siacs/conversations/ui/ShareWithActivity.java2
-rw-r--r--src/eu/siacs/conversations/xmpp/XmppConnection.java2
15 files changed, 181 insertions, 80 deletions
diff --git a/res/layout/server_info.xml b/res/layout/server_info.xml
index 25e5a4715..499a20def 100644
--- a/res/layout/server_info.xml
+++ b/res/layout/server_info.xml
@@ -12,14 +12,14 @@
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingBottom="8dp"
- android:text="Statistics" />
+ android:text="@string/server_info_statistics" />
<TextView
android:layout_below="@+id/stats_header"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Connection age"
+ android:text="@string/server_info_connection_age"
android:textSize="18sp"/>
<TextView
android:id="@+id/connection"
@@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
- android:text="Session age"
+ android:text="@string/server_info_session_age"
android:textSize="18sp"/>
<TextView
android:id="@+id/session"
@@ -53,7 +53,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView2"
- android:text="Packets sent"
+ android:text="@string/server_info_packets_sent"
android:textSize="18sp"/>
<TextView
android:id="@+id/pcks_sent"
@@ -69,7 +69,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView3"
- android:text="Packets received"
+ android:text="@string/server_info_packets_received"
android:textSize="18sp"/>
<TextView
android:id="@+id/pcks_received"
@@ -85,7 +85,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView4"
- android:text="Connected accounts"
+ android:text="@string/server_info_connected_accounts"
android:textSize="18sp"/>
<TextView
android:id="@+id/number_presences"
@@ -103,14 +103,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
- android:text="Server Features" />
+ android:text="@string/server_info_server_features" />
<TextView
android:layout_below="@+id/features_header"
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Roster Versioning"
+ android:text="@string/server_info_roster_versioning"
android:textSize="18sp"/>
<TextView
android:id="@+id/roster"
@@ -127,7 +127,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView5"
- android:text="Carbon Messages"
+ android:text="@string/server_info_carbon_messages"
android:textSize="18sp"/>
<TextView
android:id="@+id/carbon"
@@ -144,7 +144,7 @@
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView6"
- android:text="Stream Managment"
+ android:text="@string/server_info_stream_management"
android:textSize="18sp"/>
<TextView
android:id="@+id/stream"
diff --git a/res/layout/share_with.xml b/res/layout/share_with.xml
index ae73a688f..a578b2cbd 100644
--- a/res/layout/share_with.xml
+++ b/res/layout/share_with.xml
@@ -12,7 +12,7 @@
android:id="@+id/conversations_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Active Conversations"
+ android:text="@string/share_with_active_conversations"
style="@style/sectionHeader"
android:paddingLeft="8dp"
android:paddingTop="8dp"
@@ -32,7 +32,7 @@
android:id="@+id/contacts_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:text="Contacts"
+ android:text="@string/contacts"
style="@style/sectionHeader"
android:paddingLeft="8dp"
android:paddingTop="8dp"
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index ce4db1fb6..c31f2da86 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -20,6 +20,7 @@
<string name="title_activity_conference_details">Detalles de Conferencia</string>
<string name="title_activity_contact_details">Detalles de Contacto</string>
<string name="title_activity_conversations">Conversations</string>
+ <string name="title_activity_sharewith">Compartir con Conversación</string>
<string name="just_now">ahora</string>
<string name="minutes_ago">min</string>
<string name="unread_conversations">conversaciones por leer</string>
@@ -61,6 +62,7 @@
<string name="no">No</string>
<string name="ok">Ok</string>
<string name="done">Hecho</string>
+ <string name="hide">Ocultar</string>
<string name="create_invite">Crear \u0026 Invitar</string>
<string name="new_conference_explained">¿Quieres crear una nueva conferencia con una dirección generada aleatoriamente e invitar a los contactos seleccionados a ella?</string>
<string name="no_open_mucs">No hay conferencias existentes</string>
@@ -122,7 +124,7 @@
<string name="pref_xmpp_resource">Recurso</string>
<string name="pref_xmpp_resource_summary">El nombre que identifica el cliente que estás utilizando</string>
<string name="pref_accept_files">Aceptar archivos</string>
- <string name="pref_accept_files_summary">De forma automática aceptar archivos menores de&#8230;</string>
+ <string name="pref_accept_files_summary">De forma automática aceptar archivos menores que&#8230;</string>
<string name="pref_notification_settings">Ajustes de notificación</string>
<string name="pref_notifications">Notificaciones</string>
<string name="pref_notifications_summary">Notifica cuando llega un nuevo mensaje</string>
@@ -191,6 +193,7 @@
<string name="mgmt_account_enable">Habilitar</string>
<string name="mgmt_account_are_you_sure">¿Estás seguro?</string>
<string name="mgmt_account_delete_confirm_text">Si eliminas tu cuenta tu historial completo de conversaciones se perderá</string>
+ <string name="mgmt_account_account_offline">La cuenta está desconectada</string>
<string name="attach_record_voice">Grabar audio</string>
<string name="account_settings">Configuración de cuenta</string>
<string name="account_settings_jabber_id">Identificador Jabber:</string>
@@ -206,11 +209,25 @@
<string name="contact_status_online">Disponible</string>
<string name="contact_status_free_to_chat">Hablador</string>
<string name="contact_status_away">Ausente</string>
- <string name="contact_status_extended_away">Ausencia ext.</string>
+ <string name="contact_status_extended_away">Ausencia extendida</string>
<string name="contact_status_do_not_disturb">No molestar</string>
<string name="contact_status_offline">Desconectado</string>
<string name="muc_details_conference">Conferencia</string>
<string name="muc_details_conference_subject">Ausnto de la Conferencia</string>
<string name="muc_details_your_nickname">Tu apodo</string>
<string name="muc_details_other_members">Otros Miembros</string>
+ <string name="subscription_not_updated_offline">Cuenta desconectada. No se puede actualizar suscripciones</string>
+ <string name="share_with_active_conversations">Conversaciones Activas</string>
+ <string name="server_info_statistics">Estadísticas</string>
+ <string name="server_info_connection_age">Tiempo de conexión</string>
+ <string name="server_info_session_age">Duración de la sesión</string>
+ <string name="server_info_packets_sent">Paquetes enviados</string>
+ <string name="server_info_packets_received">Paquetes recibidos</string>
+ <string name="server_info_connected_accounts">Cuentas conectadas</string>
+ <string name="server_info_server_features">Características del Servidor</string>
+ <string name="server_info_roster_versioning">Roster Versioning</string>
+ <string name="server_info_carbon_messages">Mensajes Carbon</string>
+ <string name="server_info_stream_management">Stream Management</string>
+ <string name="hours">horas</string>
+ <string name="mins">mins</string>
</resources> \ No newline at end of file
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 13e43f5f3..9d6e5b388 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -20,6 +20,7 @@
<string name="title_activity_conference_details">Conference Details</string>
<string name="title_activity_contact_details">Contact Details</string>
<string name="title_activity_conversations">Conversations</string>
+ <string name="title_activity_sharewith">Share with Conversation</string>
<string name="just_now">just now</string>
<string name="minutes_ago">min ago</string>
<string name="unread_conversations">unread Conversations</string>
@@ -34,7 +35,7 @@
<string name="participant">Participant</string>
<string name="visitor">Visitor</string>
<string name="enter_new_name">Enter a new name:</string>
- <string name="remove_contact_text">Do you want to delete %s from your roster. The conversation associated with this account will not be removed.</string>
+ <string name="remove_contact_text">Do you want to delete %s from your roster? The conversation associated with this account will not be removed.</string>
<string name="untrusted_cert_hint">The server %s presented you with an untrusted, possible self signed, certificate.</string>
<string name="account_info">Server Info</string>
<string name="register_account">Register new account on server</string>
@@ -61,6 +62,7 @@
<string name="no">No</string>
<string name="ok">Ok</string>
<string name="done">Done</string>
+ <string name="hide">Hide</string>
<string name="create_invite">Create \u0026 Invite</string>
<string name="new_conference_explained">Do you want to create a new conference with a randomly generated address and invite the selected contacts to it?</string>
<string name="no_open_mucs">No existing conferences</string>
@@ -77,7 +79,7 @@
<string name="attach_file">Attach file</string>
<string name="not_in_roster">The contact is not in your roster. Would you like to add it?</string>
<string name="add_contact">Add contact</string>
- <string name="send_failed">unsuccessful delivery</string>
+ <string name="send_failed">delivery failed</string>
<string name="send_rejected">rejected</string>
<string name="receiving_image">Receiving image file. Please wait&#8230;</string>
<string name="preparing_image">Preparing image for transmission</string>
@@ -191,6 +193,7 @@
<string name="mgmt_account_enable">Enable</string>
<string name="mgmt_account_are_you_sure">Are you sure?</string>
<string name="mgmt_account_delete_confirm_text">If you delete your account your entire conversation history will be lost</string>
+ <string name="mgmt_account_account_offline">Account is offline</string>
<string name="attach_record_voice">Record voice</string>
<string name="account_settings">Account Settings</string>
<string name="account_settings_jabber_id">Jabber ID:</string>
@@ -214,4 +217,17 @@
<string name="muc_details_your_nickname">Your nickname</string>
<string name="muc_details_other_members">Other Members</string>
<string name="subscription_not_updated_offline">Account offline. Could not update subscription</string>
+ <string name="share_with_active_conversations">Active Conversations</string>
+ <string name="server_info_statistics">Statistics</string>
+ <string name="server_info_connection_age">Connection age</string>
+ <string name="server_info_session_age">Session age</string>
+ <string name="server_info_packets_sent">Packets sent</string>
+ <string name="server_info_packets_received">Packets received</string>
+ <string name="server_info_connected_accounts">Connected accounts</string>
+ <string name="server_info_server_features">Server Features</string>
+ <string name="server_info_roster_versioning">Roster Versioning</string>
+ <string name="server_info_carbon_messages">Carbon Messages</string>
+ <string name="server_info_stream_management">Stream Management</string>
+ <string name="hours">hours</string>
+ <string name="mins">mins</string>
</resources> \ No newline at end of file
diff --git a/src/eu/siacs/conversations/crypto/PgpEngine.java b/src/eu/siacs/conversations/crypto/PgpEngine.java
index 0f2aeff41..b10275f65 100644
--- a/src/eu/siacs/conversations/crypto/PgpEngine.java
+++ b/src/eu/siacs/conversations/crypto/PgpEngine.java
@@ -17,6 +17,7 @@ import org.openintents.openpgp.util.OpenPgpApi.IOpenPgpCallback;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Contact;
+import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.ui.UiCallback;
@@ -114,10 +115,15 @@ public class PgpEngine {
}
public void encrypt(final Message message,final UiCallback callback) {
- long[] keys = { message.getConversation().getContact().getPgpKeyId() };
+
Intent params = new Intent();
params.setAction(OpenPgpApi.ACTION_ENCRYPT);
- params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys);
+ if (message.getConversation().getMode() == Conversation.MODE_SINGLE) {
+ long[] keys = { message.getConversation().getContact().getPgpKeyId() };
+ params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, keys);
+ } else {
+ params.putExtra(OpenPgpApi.EXTRA_KEY_IDS, message.getConversation().getMucOptions().getPgpKeyIds());
+ }
params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, message.getConversation().getAccount().getJid());
if (message.getType() == Message.TYPE_TEXT) {
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java
index 37a230df5..a96996600 100644
--- a/src/eu/siacs/conversations/entities/Conversation.java
+++ b/src/eu/siacs/conversations/entities/Conversation.java
@@ -276,7 +276,7 @@ public class Conversation extends AbstractEntity {
public synchronized MucOptions getMucOptions() {
if (this.mucOptions == null) {
- this.mucOptions = new MucOptions();
+ this.mucOptions = new MucOptions(this.getAccount());
}
this.mucOptions.setConversation(this);
return this.mucOptions;
diff --git a/src/eu/siacs/conversations/entities/MucOptions.java b/src/eu/siacs/conversations/entities/MucOptions.java
index fbca83402..c1750334b 100644
--- a/src/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/eu/siacs/conversations/entities/MucOptions.java
@@ -3,11 +3,10 @@ package eu.siacs.conversations.entities;
import java.util.ArrayList;
import java.util.List;
-import eu.siacs.conversations.entities.MucOptions.User;
+import eu.siacs.conversations.crypto.PgpEngine;
import eu.siacs.conversations.xml.Element;
import eu.siacs.conversations.xmpp.stanzas.PresencePacket;
import android.annotation.SuppressLint;
-import android.util.Log;
@SuppressLint("DefaultLocale")
public class MucOptions {
@@ -31,6 +30,7 @@ public class MucOptions {
private int role;
private int affiliation;
private String name;
+ private long pgpKeyId = 0;
public String getName() {
return name;
@@ -70,7 +70,15 @@ public class MucOptions {
this.affiliation = AFFILIATION_NONE;
}
}
+ public void setPgpKeyId(long id) {
+ this.pgpKeyId = id;
+ }
+
+ public long getPgpKeyId() {
+ return this.pgpKeyId;
+ }
}
+ private Account account;
private ArrayList<User> users = new ArrayList<User>();
private Conversation conversation;
private boolean isOnline = false;
@@ -80,6 +88,9 @@ public class MucOptions {
private User self = new User();
private String subject = null;
+ public MucOptions(Account account) {
+ this.account = account;
+ }
public void deleteUser(String name) {
for(int i = 0; i < users.size(); ++i) {
@@ -100,7 +111,7 @@ public class MucOptions {
users.add(user);
}
- public void processPacket(PresencePacket packet) {
+ public void processPacket(PresencePacket packet, PgpEngine pgp) {
String[] fromParts = packet.getFrom().split("/");
if (fromParts.length>=2) {
String name = fromParts[1];
@@ -119,6 +130,20 @@ public class MucOptions {
} else {
addUser(user);
}
+ if (pgp != null) {
+ Element x = packet.findChild("x",
+ "jabber:x:signed");
+ if (x != null) {
+ Element status = packet.findChild("status");
+ String msg;
+ if (status != null) {
+ msg = status.getContent();
+ } else {
+ msg = "";
+ }
+ user.setPgpKeyId(pgp.fetchKeyId(account,msg, x.getContent()));
+ }
+ }
} else if (type.equals("unavailable")) {
if (name.equals(getNick())) {
Element item = packet.findChild("x","http://jabber.org/protocol/muc#user").findChild("item");
@@ -211,4 +236,18 @@ public class MucOptions {
public void flagAboutToRename() {
this.aboutToRename = true;
}
+
+ public long[] getPgpKeyIds() {
+ List<Long> ids = new ArrayList<Long>();
+ for(User user : getUsers()) {
+ if(user.getPgpKeyId()!=0) {
+ ids.add(user.getPgpKeyId());
+ }
+ }
+ long[] primitivLongArray = new long[ids.size()];
+ for(int i = 0; i < ids.size(); ++i) {
+ primitivLongArray[i] = ids.get(i);
+ }
+ return primitivLongArray;
+ }
} \ No newline at end of file
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index 3733767f9..2ccbe05c6 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -120,7 +120,12 @@ public class MessageParser {
} else {
status = Message.STATUS_RECIEVED;
}
- return new Message(conversation, counterPart, packet.getBody(), Message.ENCRYPTION_NONE, status);
+ String pgpBody = getPgpBody(packet);
+ if (pgpBody==null) {
+ return new Message(conversation, counterPart, packet.getBody(), Message.ENCRYPTION_NONE, status);
+ } else {
+ return new Message(conversation, counterPart, pgpBody, Message.ENCRYPTION_PGP, status);
+ }
}
public Message parseCarbonMessage(MessagePacket packet,Account account) {
@@ -160,11 +165,11 @@ public class MessageParser {
}
public String getPgpBody(MessagePacket packet) {
- for(Element child : packet.getChildren()) {
- if (child.getName().equals("x")&&child.getAttribute("xmlns").equals("jabber:x:encrypted")) {
- return child.getContent();
- }
+ Element child = packet.findChild("x", "jabber:x:encrypted");
+ if (child==null) {
+ return null;
+ } else {
+ return child.getContent();
}
- return null;
}
}
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index e31d28e02..d1692a440 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -279,7 +279,7 @@ public class XmppConnectionService extends Service {
Conversation muc = findMuc(
packet.getAttribute("from").split("/")[0], account);
if (muc != null) {
- muc.getMucOptions().processPacket(packet);
+ muc.getMucOptions().processPacket(packet,getPgpEngine());
} else {
Log.d(LOGTAG, account.getJid()
+ ": could not find muc for received muc package "
@@ -293,7 +293,7 @@ public class XmppConnectionService extends Service {
account.getJid() + ": reading muc status packet "
+ packet.toString());
int error = muc.getMucOptions().getError();
- muc.getMucOptions().processPacket(packet);
+ muc.getMucOptions().processPacket(packet,getPgpEngine());
if ((muc.getMucOptions().getError() != error)
&& (convChangedListener != null)) {
Log.d(LOGTAG, "muc error status changed");
@@ -1107,6 +1107,7 @@ public class XmppConnectionService extends Service {
}
public void joinMuc(Conversation conversation) {
+ Account account = conversation.getAccount();
String[] mucParts = conversation.getContactJid().split("/");
String muc;
String nick;
@@ -1115,19 +1116,24 @@ public class XmppConnectionService extends Service {
nick = mucParts[1];
} else {
muc = mucParts[0];
- nick = conversation.getAccount().getUsername();
+ nick = account.getUsername();
}
PresencePacket packet = new PresencePacket();
packet.setAttribute("to", muc + "/" + nick);
Element x = new Element("x");
x.setAttribute("xmlns", "http://jabber.org/protocol/muc");
+ String sig = account.getPgpSignature();
+ if (sig != null) {
+ packet.addChild("status").setContent("online");
+ packet.addChild("x", "jabber:x:signed").setContent(sig);
+ }
if (conversation.getMessages().size() != 0) {
long lastMsgTime = conversation.getLatestMessage().getTimeSent();
long diff = (System.currentTimeMillis() - lastMsgTime) / 1000 - 1;
x.addChild("history").setAttribute("seconds", diff + "");
}
packet.addChild(x);
- conversation.getAccount().getXmppConnection()
+ account.getXmppConnection()
.sendPresencePacket(packet);
}
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index bd98e9799..c696fa45f 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -321,7 +321,6 @@ public class ConversationActivity extends XmppActivity {
if (this.getSelectedConversation() != null) {
if (this.getSelectedConversation().getMode() == Conversation.MODE_MULTI) {
menuContactDetails.setVisible(false);
- menuSecure.setVisible(false);
menuAttach.setVisible(false);
} else {
menuMucDetails.setVisible(false);
@@ -536,14 +535,17 @@ public class ConversationActivity extends XmppActivity {
}
});
popup.inflate(R.menu.encryption_choices);
+ MenuItem otr = popup.getMenu().findItem(R.id.encryption_choice_otr);
+ if (conversation.getMode() == Conversation.MODE_MULTI) {
+ otr.setVisible(false);
+ }
switch (conversation.getNextEncryption()) {
case Message.ENCRYPTION_NONE:
popup.getMenu().findItem(R.id.encryption_choice_none)
.setChecked(true);
break;
case Message.ENCRYPTION_OTR:
- popup.getMenu().findItem(R.id.encryption_choice_otr)
- .setChecked(true);
+ otr.setChecked(true);
break;
case Message.ENCRYPTION_PGP:
popup.getMenu().findItem(R.id.encryption_choice_pgp)
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index 44d1848fe..a3cecfd48 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -678,37 +678,41 @@ public class ConversationFragment extends Fragment {
final XmppConnectionService xmppService = activity.xmppConnectionService;
final Contact contact = message.getConversation().getContact();
if (activity.hasPgp()) {
- if (contact.getPgpKeyId() != 0) {
- xmppService.getPgpEngine().hasKey(contact, new UiCallback() {
-
- @Override
- public void userInputRequried(PendingIntent pi) {
- activity.runIntent(pi,
- ConversationActivity.REQUEST_ENCRYPT_MESSAGE);
- }
-
- @Override
- public void success() {
- activity.encryptTextMessage();
- }
-
- @Override
- public void error(int error) {
-
- }
- });
-
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ if (contact.getPgpKeyId() != 0) {
+ xmppService.getPgpEngine().hasKey(contact, new UiCallback() {
+
+ @Override
+ public void userInputRequried(PendingIntent pi) {
+ activity.runIntent(pi,
+ ConversationActivity.REQUEST_ENCRYPT_MESSAGE);
+ }
+
+ @Override
+ public void success() {
+ activity.encryptTextMessage();
+ }
+
+ @Override
+ public void error(int error) {
+
+ }
+ });
+
+ } else {
+ showNoPGPKeyDialog(new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ conversation.setNextEncryption(Message.ENCRYPTION_NONE);
+ message.setEncryption(Message.ENCRYPTION_NONE);
+ xmppService.sendMessage(message, null);
+ chatMsg.setText("");
+ }
+ });
+ }
} else {
- showNoPGPKeyDialog(new DialogInterface.OnClickListener() {
-
- @Override
- public void onClick(DialogInterface dialog, int which) {
- conversation.setNextEncryption(Message.ENCRYPTION_NONE);
- message.setEncryption(Message.ENCRYPTION_NONE);
- xmppService.sendMessage(message, null);
- chatMsg.setText("");
- }
- });
+ activity.encryptTextMessage();
}
}
}
diff --git a/src/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
index 70af44e0f..d1c9c7f72 100644
--- a/src/eu/siacs/conversations/ui/ManageAccountActivity.java
+++ b/src/eu/siacs/conversations/ui/ManageAccountActivity.java
@@ -317,36 +317,36 @@ public class ManageAccountActivity extends XmppActivity {
pcks_received.setText(""+xmpp.getReceivedStanzas());
pcks_sent.setText(""+xmpp.getSentStanzas());
if (connectionAgeHours >= 2) {
- connection.setText(connectionAgeHours+" hours");
+ connection.setText(connectionAgeHours+" " + getString(R.string.hours));
} else {
- connection.setText(connectionAge+" mins");
+ connection.setText(connectionAge+" " + getString(R.string.mins));
}
if (xmpp.hasFeatureStreamManagment()) {
if (sessionAgeHours >= 2) {
- session.setText(sessionAgeHours+" hours");
+ session.setText(sessionAgeHours+" " + getString(R.string.hours));
} else {
- session.setText(sessionAge+" mins");
+ session.setText(sessionAge+" " + getString(R.string.mins));
}
- stream.setText("Yes");
+ stream.setText(getString(R.string.yes));
} else {
- stream.setText("No");
+ stream.setText(getString(R.string.no));
session.setText(connection.getText());
}
if (xmpp.hasFeaturesCarbon()) {
- carbon.setText("Yes");
+ carbon.setText(getString(R.string.yes));
} else {
- carbon.setText("No");
+ carbon.setText(getString(R.string.no));
}
if (xmpp.hasFeatureRosterManagment()) {
- roster.setText("Yes");
+ roster.setText(getString(R.string.yes));
} else {
- roster.setText("No");
+ roster.setText(getString(R.string.no));
}
builder.setView(view);
} else {
- builder.setMessage("Account is offline");
+ builder.setMessage(getString(R.string.mgmt_account_account_offline));
}
- builder.setPositiveButton("Hide", null);
+ builder.setPositiveButton(getString(R.string.hide), null);
builder.create().show();
}
return true;
diff --git a/src/eu/siacs/conversations/ui/MucDetailsActivity.java b/src/eu/siacs/conversations/ui/MucDetailsActivity.java
index d1725d41c..48cf6e81e 100644
--- a/src/eu/siacs/conversations/ui/MucDetailsActivity.java
+++ b/src/eu/siacs/conversations/ui/MucDetailsActivity.java
@@ -3,6 +3,8 @@ package eu.siacs.conversations.ui;
import java.util.ArrayList;
import java.util.List;
+import org.openintents.openpgp.util.OpenPgpUtils;
+
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.MucOptions;
@@ -176,7 +178,11 @@ public class MucDetailsActivity extends XmppActivity {
((TextView) view.findViewById(R.id.contact_display_name))
.setText(contact.getName());
TextView role = (TextView) view.findViewById(R.id.contact_jid);
- role.setText(getReadableRole(contact.getRole()));
+ if (contact.getPgpKeyId()==0) {
+ role.setText(getReadableRole(contact.getRole()));
+ } else {
+ role.setText(getReadableRole(contact.getRole())+" \u00B7 "+OpenPgpUtils.convertKeyIdToHex(contact.getPgpKeyId()));
+ }
ImageView imageView = (ImageView) view
.findViewById(R.id.contact_photo);
imageView.setImageBitmap(UIHelper.getContactPicture(contact.getName(), 48,this.getApplicationContext(), false));
diff --git a/src/eu/siacs/conversations/ui/ShareWithActivity.java b/src/eu/siacs/conversations/ui/ShareWithActivity.java
index 6dbb20c96..0a8ee1a70 100644
--- a/src/eu/siacs/conversations/ui/ShareWithActivity.java
+++ b/src/eu/siacs/conversations/ui/ShareWithActivity.java
@@ -34,7 +34,7 @@ public class ShareWithActivity extends XmppActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.share_with);
- setTitle("Share with Conversation");
+ setTitle(getString(R.string.title_activity_sharewith));
contacts = (LinearLayout) findViewById(R.id.contacts);
conversations = (LinearLayout) findViewById(R.id.conversations);
diff --git a/src/eu/siacs/conversations/xmpp/XmppConnection.java b/src/eu/siacs/conversations/xmpp/XmppConnection.java
index a1aaf66a1..74639d427 100644
--- a/src/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -898,7 +898,7 @@ public class XmppConnection implements Runnable {
}
}
}
- });
+ }).start();
} catch (IOException e) {
Log.d(LOGTAG, "io exception during disconnect");
}