diff options
Diffstat (limited to 'src/main')
9 files changed, 127 insertions, 42 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java index 16635f7c..47861d06 100644 --- a/src/main/java/eu/siacs/conversations/entities/Message.java +++ b/src/main/java/eu/siacs/conversations/entities/Message.java @@ -73,14 +73,21 @@ public class Message extends AbstractEntity { } public Message(Conversation conversation, String body, int encryption, int status) { - this(java.util.UUID.randomUUID().toString(), conversation.getUuid(), - conversation.getContactJid().toBareJid(), null, body, System - .currentTimeMillis(), encryption, - status, TYPE_TEXT, null, null); + this(java.util.UUID.randomUUID().toString(), + conversation.getUuid(), + conversation.getContactJid() == null ? null : conversation.getContactJid().toBareJid(), + null, + body, + System.currentTimeMillis(), + encryption, + status, + TYPE_TEXT, + null, + null); this.conversation = conversation; } - public Message(final String uuid, final String conversationUUid, final Jid counterpart, + private Message(final String uuid, final String conversationUUid, final Jid counterpart, final Jid trueCounterpart, final String body, final long timeSent, final int encryption, final int status, final int type, final String remoteMsgId, final String relativeFilePath) { this.uuid = uuid; diff --git a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java index 419964ea..cd212943 100644 --- a/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/AbstractGenerator.java @@ -20,7 +20,7 @@ public abstract class AbstractGenerator { "http://jabber.org/protocol/disco#info", "urn:xmpp:avatar:metadata+notify", "urn:xmpp:ping"}; - public final String IDENTITY_NAME = "Conversations 0.9-alpha"; + public final String IDENTITY_NAME = "Conversations 0.9.1"; public final String IDENTITY_TYPE = "phone"; protected XmppConnectionService mXmppConnectionService; diff --git a/src/main/java/eu/siacs/conversations/parser/IqParser.java b/src/main/java/eu/siacs/conversations/parser/IqParser.java index b38cdc72..aeec56d0 100644 --- a/src/main/java/eu/siacs/conversations/parser/IqParser.java +++ b/src/main/java/eu/siacs/conversations/parser/IqParser.java @@ -25,14 +25,11 @@ public class IqParser extends AbstractParser implements OnIqPacketReceived { } for (Element item : query.getChildren()) { if (item.getName().equals("item")) { - Jid jid; - try { - jid = Jid.fromString(item.getAttribute("jid")); - } catch (final InvalidJidException e) { - // TODO: Handle this? - jid = null; - } - String name = item.getAttribute("name"); + final Jid jid = item.getAttributeAsJid("jid"); + if (jid == null) { + break; + } + String name = item.getAttribute("name"); String subscription = item.getAttribute("subscription"); Contact contact = account.getRoster().getContact(jid); if (!contact.getOption(Contact.Options.DIRTY_PUSH)) { diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index 0f9761e5..5b0fa562 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -771,12 +771,8 @@ public class ConversationActivity extends XmppActivity implements super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK) { if (requestCode == REQUEST_DECRYPT_PGP) { - ConversationFragment selectedFragment = (ConversationFragment) getFragmentManager() - .findFragmentByTag("conversation"); - if (selectedFragment != null) { - selectedFragment.hideSnackbar(); - selectedFragment.updateMessages(); - } + mConversationFragment.hideSnackbar(); + mConversationFragment.updateMessages(); } else if (requestCode == REQUEST_ATTACH_IMAGE_DIALOG) { mPendingImageUri = data.getData(); if (xmppConnectionServiceBound) { diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 287d1636..1d26ff8a 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -35,6 +35,7 @@ import net.java.otr4j.session.SessionStatus; import java.util.ArrayList; import java.util.List; +import java.util.NoSuchElementException; import java.util.concurrent.ConcurrentLinkedQueue; import eu.siacs.conversations.R; @@ -503,6 +504,8 @@ public class ConversationFragment extends Fragment { } this.activity = (ConversationActivity) getActivity(); this.conversation = conversation; + this.mDecryptJobRunning = false; + this.mEncryptedMessages.clear(); if (this.conversation.getMode() == Conversation.MODE_MULTI) { this.conversation.setNextCounterpart(null); } @@ -626,7 +629,11 @@ public class ConversationFragment extends Fragment { @Override public void success(Message message) { mDecryptJobRunning = false; - mEncryptedMessages.remove(); + try { + mEncryptedMessages.remove(); + } catch (final NoSuchElementException ignored) { + + } activity.xmppConnectionService.updateMessage(message); } @@ -634,7 +641,11 @@ public class ConversationFragment extends Fragment { public void error(int error, Message message) { message.setEncryption(Message.ENCRYPTION_DECRYPTION_FAILED); mDecryptJobRunning = false; - mEncryptedMessages.remove(); + try { + mEncryptedMessages.remove(); + } catch (final NoSuchElementException ignored) { + + } activity.xmppConnectionService.updateConversationUi(); } }); diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java index 143dfda1..0993735f 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/KnownHostsAdapter.java @@ -60,11 +60,8 @@ public class KnownHostsAdapter extends ArrayAdapter<String> { public KnownHostsAdapter(Context context, int viewResourceId, List<String> mKnownHosts) { - super(context, viewResourceId, mKnownHosts); - domains = new ArrayList<String>(mKnownHosts.size()); - for (String domain : mKnownHosts) { - domains.add(new String(domain)); - } + super(context, viewResourceId, new ArrayList<String>()); + domains = new ArrayList<String>(mKnownHosts); } @Override diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 2f5994c4..fb151427 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -848,11 +848,9 @@ public class XmppConnection implements Runnable { List<Element> elements = packet.query().getChildren(); for (Element element : elements) { if (element.getName().equals("item")) { - final String jid = element.getAttribute("jid"); - try { - sendServiceDiscoveryInfo(Jid.fromString(jid).toDomainJid()); - } catch (final InvalidJidException ignored) { - // TODO: Handle the case where an external JID is technically invalid? + final Jid jid = element.getAttributeAsJid("jid"); + if (jid != null && !jid.equals(account.getServer())) { + sendServiceDiscoveryInfo(jid); } } } diff --git a/src/main/res/values-it/arrays.xml b/src/main/res/values-it/arrays.xml index 491c4438..60c0b04f 100644 --- a/src/main/res/values-it/arrays.xml +++ b/src/main/res/values-it/arrays.xml @@ -25,7 +25,7 @@ <item>un\'ora</item> <item>2 ore</item> <item>8 ore</item> - <item>fino avviso ulteriore</item> + <item>fino a nuovo avviso</item> </string-array> <integer-array name="mute_options_durations"> diff --git a/src/main/res/values-it/strings.xml b/src/main/res/values-it/strings.xml index 3b613e9d..dab7471d 100644 --- a/src/main/res/values-it/strings.xml +++ b/src/main/res/values-it/strings.xml @@ -40,18 +40,18 @@ <string name="start_conversation">Inizia Conversazione</string> <string name="invite_contact">Invita Contatto</string> <string name="contacts">Contatti</string> - <string name="cancel">Cancella</string> + <string name="cancel">Annulla</string> <string name="add">Aggiungi</string> <string name="edit">Modifica</string> <string name="delete">Elimina</string> <string name="save">Salva</string> <string name="ok">OK</string> - <string name="crash_report_title">Conversations è crashato</string> + <string name="crash_report_title">Errore di Conversations</string> <string name="crash_report_message">Se scegli di inviare una segnalazione dell\'errore aiuterai lo sviluppo di Conversations\n<b>Attenzione:</b> Questo utilizzerà il tuo account XMPP per inviare la segnalazione agli sviluppatori.</string> <string name="send_now">Invia adesso</string> <string name="send_never">Non chiedere mai più</string> - <string name="problem_connecting_to_account">Impossibile collegarsi all\'utente</string> - <string name="problem_connecting_to_accounts">Impossibile collegarsi a più utenti</string> + <string name="problem_connecting_to_account">Impossibile collegarsi tramite questo utente</string> + <string name="problem_connecting_to_accounts">Impossibile collegarsi tramite più utenti</string> <string name="touch_to_fix">Tocca qui per gestire i tuoi utenti</string> <string name="attach_file">Allega file</string> <string name="not_in_roster">Il contatto non è nella tua lista. Vuoi aggiungerlo?</string> @@ -66,10 +66,10 @@ <string name="delete_messages">Elimina messaggi</string> <string name="also_end_conversation">Termina questa conversazione in seguito</string> <string name="choose_presence">Choose presence to contact</string> - <string name="send_plain_text_message">Invia messaggio di testo semplice</string> - <string name="send_otr_message">Invia messaggio cifrato con OTR</string> - <string name="send_pgp_message">Invia messaggio cifrato con OpenPGP</string> - <string name="your_nick_has_been_changed">Il tuo nome utente èstato cambiato</string> + <string name="send_plain_text_message">Messaggio non cifrato</string> + <string name="send_otr_message">Messaggio OTR</string> + <string name="send_pgp_message">Messaggio OpenPGP</string> + <string name="your_nick_has_been_changed">Il tuo nome utente è stato cambiato</string> <string name="download_image">Scarica Immagine</string> <string name="image_offered_for_download"><i>Immagine disponibile per il download</i></string> <string name="send_unencrypted">Invia non cifrato</string> @@ -141,6 +141,8 @@ <string name="account_status_regis_conflict">Nome utente già in uso</string> <string name="account_status_regis_success">Registrazione completata</string> <string name="account_status_regis_not_sup">Il Server non supporta la registrazione</string> + <string name="account_status_security_error">Errore di sicurezza</string> + <string name="account_status_incompatible_server">Server non compatibile</string> <string name="encryption_choice_none">Testo semplice</string> <string name="encryption_choice_otr">OTR</string> <string name="encryption_choice_pgp">OpenPGP</string> @@ -250,11 +252,88 @@ <string name="pref_force_encryption_summary">Manda sempre messaggi cifrati (ad eccezione delle conferenze)</string> <string name="pref_dont_save_encrypted">Non salvare i messaggi cifrati</string> <string name="pref_dont_save_encrypted_summary">Attenzione: Questo potrebbe comportare la perdita di messaggi</string> + <string name="pref_enable_legacy_ssl">Abilita il vecchio SSL</string> + <string name="pref_enable_legacy_ssl_summary">Abilita il supporto per i server SSLv3. Attenzione: SSLv3 è considerato insicuro.</string> <string name="pref_expert_options">Opzioni da Esperto</string> <string name="pref_expert_options_summary">Fai attenzione con queste impostazioni</string> + <string name="title_activity_about">Info su Conversations</string> + <string name="pref_about_conversations_summary">Informazioni sulla licenza</string> <string name="pref_use_larger_font">Aumenta la dimensione dei font</string> <string name="pref_use_larger_font_summary">Usa font più grandi in tutta l\'app</string> <string name="pref_use_send_button_to_indicate_status">Il pulsante di invio indica lo stato</string> <string name="pref_use_send_button_to_indicate_status_summary">Colora il pulsante di invio per indicare lo stato di un contatto</string> - + <string name="pref_use_indicate_received">Richiedi la ricevuta di ritorno</string> + <string name="pref_use_indicate_received_summary">I messaggi ricevuti verranno contrassegnati con una spunta verde se supportato</string> + <string name="pref_expert_options_other">Altro</string> + <string name="pref_conference_name">Nome della conferenza</string> + <string name="pref_conference_name_summary">Usa il soggetto della stanza al posto del JID per identificare le conferenze</string> + <string name="toast_message_otr_fingerprint">Impronta OTR copiata!</string> + <string name="conference_banned">Sei stato bandito da questa conferenza</string> + <string name="conference_members_only">Questa conferenza è solo per membri</string> + <string name="conference_kicked">Sei stato buttato fuori dalla conferenza</string> + <string name="using_account">usando l\'utente %s</string> + <string name="checking_image">Controlla immagine su HTTP</string> + <string name="image_file_deleted">Il file dell\'immagine è stato cancellato</string> + <string name="not_connected_try_again">Non sei connesso. Riprova più tardi</string> + <string name="check_image_filesize">Controlla le dimensioni dell\'immagine</string> + <string name="message_options">Opzioni del messaggio</string> + <string name="copy_text">Copia testo</string> + <string name="share_image">Condividi immagine</string> + <string name="copy_original_url">Copia URL originale</string> + <string name="send_again">Invia di nuovo</string> + <string name="image_url">URL immagine</string> + <string name="message_text">Messaggio di testo</string> + <string name="url_copied_to_clipboard">URL copiato</string> + <string name="message_copied_to_clipboard">Messaggio copiato</string> + <string name="image_transmission_failed">Trasmissione dell\'immagine fallita</string> + <string name="scan_qr_code">Scansiona codice QR</string> + <string name="show_qr_code">Mostra codice QR</string> + <string name="account_details">Dettagli utente</string> + <string name="verify_otr">Verifica OTR</string> + <string name="remote_fingerprint">Impronta remota</string> + <string name="scan">scan</string> + <string name="or_touch_phones">(o fai toccare i dispositivi)</string> + <string name="smp">Socialist Millionaire Protocol</string> + <string name="shared_secret_hint">Suggerimento o Domanda</string> + <string name="shared_secret_secret">Segreto condiviso</string> + <string name="confirm">Conferma</string> + <string name="in_progress">In corso</string> + <string name="respond">Rispondi</string> + <string name="failed">Fallito</string> + <string name="secrets_do_not_match">I segreti non corrispondono</string> + <string name="try_again">Prova di nuovo</string> + <string name="finish">Fine</string> + <string name="verified">Verificato!</string> + <string name="smp_requested">Il contatto ha richiesto la verifica SMP</string> + <string name="no_otr_session_found">Non è stata trovata nessuna sessione OTR valida!</string> + <string name="conversations_foreground_service">Conversations</string> + <string name="touch_to_disable">Tocca per disabilitare il servizio in primo piano</string> + <string name="pref_keep_foreground_service">Mantieni il servizio in primo piano</string> + <string name="pref_keep_foreground_service_summary">Evita che il sistema operativo chiuda la connessione</string> + <string name="choose_file">Scegli file</string> + <string name="receiving_file">Ricezione di %1$s file (%2$d%% completato)</string> + <string name="download_file">Scarica %s file</string> + <string name="open_file">Apri %s file</string> + <string name="sending_file">invio (%1$d%% completato)</string> + <string name="preparing_file">Preparazione alla trasmissione del file</string> + <string name="file_offered_for_download">Offerto un file da scaricare</string> + <string name="file">%s file</string> + <string name="cancel_transmission">Annulla trasmissione</string> + <string name="file_transmission_failed">trasmissione del file fallita</string> + <string name="file_deleted">Il file è stato eliminato</string> + <string name="no_application_found_to_open_file">Nessuna applicazione trovata per aprire il file</string> + <string name="could_not_verify_fingerprint">Impronta non verificata</string> + <string name="manually_verify">Verifica manuale</string> + <string name="are_you_sure_verify_fingerprint">Sei sicuro di voler verificare l\'impronta OTR del contatto?</string> + <string name="pref_show_dynamic_tags">Mostra tag dinamici</string> + <string name="pref_show_dynamic_tags_summary">Mostra tag in sola lettura sotto i contatti</string> + <string name="enable_notifications">Abilita le notifiche</string> + <string name="conference_with">Crea conferenza con…</string> + <string name="no_conference_server_found">Nessun server per conferenza trovato</string> + <string name="conference_creation_failed">Creazione della conferenza fallita!</string> + <string name="conference_created">Conferenza creata!</string> + <string name="secret_accepted">Segreto accettato!</string> + <string name="reset">Reset</string> + <string name="account_image_description">Avatar utente</string> + <string name="copy_otr_clipboard_description">Copia impronta OTR</string> </resources> |