Merge remote-tracking branch 'refs/remotes/siacs/master'
This commit is contained in:
commit
ca34be385e
14 changed files with 103 additions and 53 deletions
|
@ -1,5 +1,9 @@
|
|||
###Changelog
|
||||
|
||||
####Version 1.12.3
|
||||
* show offline members in conferences
|
||||
* various bug fixes
|
||||
|
||||
####Version 1.12.2
|
||||
* make omemo default when all resources support it
|
||||
* show presence of other resources as template
|
||||
|
|
|
@ -65,8 +65,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 23
|
||||
versionCode 143
|
||||
versionName "1.12.2"
|
||||
versionCode 144
|
||||
versionName "1.12.3"
|
||||
archivesBaseName += "-$versionName"
|
||||
applicationId "eu.siacs.conversations"
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ public final class Config {
|
|||
public static final boolean DISABLE_HTTP_UPLOAD = false;
|
||||
public static final boolean DISABLE_STRING_PREP = false; // setting to true might increase startup performance
|
||||
public static final boolean EXTENDED_SM_LOGGING = false; // log stanza counts
|
||||
public static final boolean BACKGROUND_STANZA_LOGGING = true;
|
||||
public static final boolean BACKGROUND_STANZA_LOGGING = false;
|
||||
public static final boolean RESET_ATTEMPT_COUNT_ON_NETWORK_CHANGE = true; //setting to true might increase power consumption
|
||||
|
||||
public static final boolean ENCRYPT_ON_HTTP_UPLOADED = false;
|
||||
|
|
|
@ -97,6 +97,21 @@ public class Conversation extends AbstractEntity implements Blockable {
|
|||
this.messagesLeftOnServer = value;
|
||||
}
|
||||
|
||||
|
||||
public Message getFirstUnreadMessage() {
|
||||
Message first = null;
|
||||
synchronized (this.messages) {
|
||||
for (int i = messages.size() - 1; i >= 0; --i) {
|
||||
if (messages.get(i).isRead()) {
|
||||
return first;
|
||||
} else {
|
||||
first = messages.get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
public Message findUnsentMessageWithUuid(String uuid) {
|
||||
synchronized(this.messages) {
|
||||
for (final Message message : this.messages) {
|
||||
|
|
|
@ -574,6 +574,9 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
|
|||
+conversation.getJid().toBareJid());
|
||||
if (!user.realJidMatchesAccount()) {
|
||||
conversation.getMucOptions().addUser(user);
|
||||
mXmppConnectionService.getAvatarService().clear(conversation);
|
||||
mXmppConnectionService.updateMucRosterUi();
|
||||
mXmppConnectionService.updateConversationUi();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1903,6 +1903,9 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
|
|||
MucOptions.User user = AbstractParser.parseItem(conversation,child);
|
||||
if (!user.realJidMatchesAccount()) {
|
||||
conversation.getMucOptions().addUser(user);
|
||||
getAvatarService().clear(conversation);
|
||||
updateMucRosterUi();
|
||||
updateConversationUi();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -253,6 +253,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
quickEdit(mConversation.getMucOptions().getActualNick(),
|
||||
0,
|
||||
new OnValueEdited() {
|
||||
|
||||
@Override
|
||||
|
@ -279,7 +280,9 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
|
|||
break;
|
||||
case R.id.action_edit_subject:
|
||||
if (mConversation != null) {
|
||||
quickEdit(mConversation.getName(),this.onSubjectEdited);
|
||||
quickEdit(mConversation.getMucOptions().getSubject(),
|
||||
R.string.action_edit_subject,
|
||||
this.onSubjectEdited);
|
||||
}
|
||||
break;
|
||||
case R.id.action_share:
|
||||
|
|
|
@ -259,7 +259,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
|
|||
break;
|
||||
case R.id.action_edit_contact:
|
||||
if (contact.getSystemAccount() == null) {
|
||||
quickEdit(contact.getDisplayName(), new OnValueEdited() {
|
||||
quickEdit(contact.getDisplayName(), 0, new OnValueEdited() {
|
||||
|
||||
@Override
|
||||
public void onValueEdited(String value) {
|
||||
|
|
|
@ -123,27 +123,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
|||
|
||||
}
|
||||
|
||||
private int getIndexOf(String uuid, List<Message> messages) {
|
||||
if (uuid == null) {
|
||||
return messages.size() - 1;
|
||||
}
|
||||
for(int i = 0; i < messages.size(); ++i) {
|
||||
if (uuid.equals(messages.get(i).getUuid())) {
|
||||
return i;
|
||||
} else {
|
||||
Message next = messages.get(i);
|
||||
while(next != null && next.wasMergedIntoPrevious()) {
|
||||
if (uuid.equals(next.getUuid())) {
|
||||
return i;
|
||||
}
|
||||
next = next.next();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem,
|
||||
int visibleItemCount, int totalItemCount) {
|
||||
|
@ -212,6 +191,28 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
private int getIndexOf(String uuid, List<Message> messages) {
|
||||
if (uuid == null) {
|
||||
return messages.size() - 1;
|
||||
}
|
||||
for(int i = 0; i < messages.size(); ++i) {
|
||||
if (uuid.equals(messages.get(i).getUuid())) {
|
||||
return i;
|
||||
} else {
|
||||
Message next = messages.get(i);
|
||||
while(next != null && next.wasMergedIntoPrevious()) {
|
||||
if (uuid.equals(next.getUuid())) {
|
||||
return i;
|
||||
}
|
||||
next = next.next();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private final int KEYCHAIN_UNLOCK_NOT_REQUIRED = 0;
|
||||
private final int KEYCHAIN_UNLOCK_REQUIRED = 1;
|
||||
private final int KEYCHAIN_UNLOCK_PENDING = 2;
|
||||
|
@ -807,9 +808,15 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
|
|||
this.messagesView.setAdapter(messageListAdapter);
|
||||
updateMessages();
|
||||
this.messagesLoaded = true;
|
||||
int size = this.messageList.size();
|
||||
if (size > 0) {
|
||||
messagesView.setSelection(size - 1);
|
||||
synchronized (this.messageList) {
|
||||
final Message first = conversation.getFirstUnreadMessage();
|
||||
final int pos;
|
||||
if (first == null) {
|
||||
pos = Math.max(0,this.messageList.size() - 1);
|
||||
} else {
|
||||
pos = getIndexOf(first.getUuid(), this.messageList);
|
||||
}
|
||||
messagesView.setSelection(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -670,18 +670,19 @@ public abstract class XmppActivity extends Activity {
|
|||
builder.create().show();
|
||||
}
|
||||
|
||||
protected void quickEdit(String previousValue, OnValueEdited callback) {
|
||||
quickEdit(previousValue, callback, false);
|
||||
protected void quickEdit(String previousValue, int hint, OnValueEdited callback) {
|
||||
quickEdit(previousValue, callback, hint, false);
|
||||
}
|
||||
|
||||
protected void quickPasswordEdit(String previousValue,
|
||||
OnValueEdited callback) {
|
||||
quickEdit(previousValue, callback, true);
|
||||
protected void quickPasswordEdit(String previousValue, OnValueEdited callback) {
|
||||
quickEdit(previousValue, callback, R.string.password, true);
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private void quickEdit(final String previousValue,
|
||||
final OnValueEdited callback, boolean password) {
|
||||
final OnValueEdited callback,
|
||||
final int hint,
|
||||
boolean password) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
View view = getLayoutInflater().inflate(R.layout.quickedit, null);
|
||||
final EditText editor = (EditText) view.findViewById(R.id.editor);
|
||||
|
@ -690,7 +691,7 @@ public abstract class XmppActivity extends Activity {
|
|||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String value = editor.getText().toString();
|
||||
if (!previousValue.equals(value) && value.trim().length() > 0) {
|
||||
if (!value.equals(previousValue) && value.trim().length() > 0) {
|
||||
callback.onValueEdited(value);
|
||||
}
|
||||
}
|
||||
|
@ -698,13 +699,18 @@ public abstract class XmppActivity extends Activity {
|
|||
if (password) {
|
||||
editor.setInputType(InputType.TYPE_CLASS_TEXT
|
||||
| InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||
editor.setHint(R.string.password);
|
||||
builder.setPositiveButton(R.string.accept, mClickListener);
|
||||
} else {
|
||||
builder.setPositiveButton(R.string.edit, mClickListener);
|
||||
}
|
||||
if (hint != 0) {
|
||||
editor.setHint(hint);
|
||||
}
|
||||
editor.requestFocus();
|
||||
editor.setText(previousValue);
|
||||
editor.setText("");
|
||||
if (previousValue != null) {
|
||||
editor.getText().append(previousValue);
|
||||
}
|
||||
builder.setView(view);
|
||||
builder.setNegativeButton(R.string.cancel, null);
|
||||
builder.create().show();
|
||||
|
|
|
@ -47,7 +47,10 @@ public class DNSHelper {
|
|||
|
||||
protected static Client client = new Client();
|
||||
|
||||
protected static Context context;
|
||||
|
||||
public static Bundle getSRVRecord(final Jid jid, Context context) throws IOException {
|
||||
DNSHelper.context = context;
|
||||
final String host = jid.getDomainpart();
|
||||
final List<InetAddress> servers = Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? getDnsServers(context) : getDnsServersPreLollipop();
|
||||
Bundle b = new Bundle();
|
||||
|
|
|
@ -27,19 +27,7 @@ public class ExceptionHandler implements UncaughtExceptionHandler {
|
|||
ex.printStackTrace(printWriter);
|
||||
String stacktrace = result.toString();
|
||||
printWriter.close();
|
||||
try {
|
||||
OutputStream os = context.openFileOutput("stacktrace.txt",
|
||||
Context.MODE_PRIVATE);
|
||||
os.write(stacktrace.getBytes());
|
||||
os.flush();
|
||||
os.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
ExceptionHelper.writeToStacktraceFile(context, stacktrace);
|
||||
this.defaultHandler.uncaughtException(thread, ex);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,8 +14,10 @@ import android.util.Log;
|
|||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
|
||||
import eu.siacs.conversations.Config;
|
||||
|
@ -119,4 +121,14 @@ public class ExceptionHelper {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeToStacktraceFile(Context context, String msg) {
|
||||
try {
|
||||
OutputStream os = context.openFileOutput("stacktrace.txt", Context.MODE_PRIVATE);
|
||||
os.write(msg.getBytes());
|
||||
os.flush();
|
||||
os.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,6 +155,9 @@
|
|||
<string name="mgmt_account_delete">Löschen</string>
|
||||
<string name="mgmt_account_publish_avatar">Profilbild veröffentlichen</string>
|
||||
<string name="mgmt_account_publish_pgp">Öffentlichen OpenPGP-Schlüssel veröffentlichen</string>
|
||||
<string name="openpgp_has_been_published">Öffentlicher OpenPGP Schlüssel wurde veröffentlicht.</string>
|
||||
<string name="republish_pgp_keys">Deine öffentliche OpenPGP Schlüssel müssen veröffentlicht werden!</string>
|
||||
<string name="mgmt_account_enable">Konto aktivieren </string>
|
||||
<string name="mgmt_account_are_you_sure">Bist du dir sicher?</string>
|
||||
<string name="mgmt_account_delete_confirm_text">Wenn du dein Profil löschst, gehen alle Gesprächsverläufe verloren</string>
|
||||
<string name="attach_record_voice">Sprache aufzeichnen</string>
|
||||
|
@ -367,7 +370,7 @@
|
|||
<string name="password_should_not_be_empty">Das Passwort darf nicht leer sein</string>
|
||||
<string name="perform_action_with">Aktion durchführen mit</string>
|
||||
<string name="no_affiliation">Keine Zugehörigkeit</string>
|
||||
<string name="no_role">Keine Rolle</string>
|
||||
<string name="no_role">Offline</string>
|
||||
<string name="outcast">Ausgeschlossen</string>
|
||||
<string name="member">Mitglied</string>
|
||||
<string name="advanced_mode">Erweiterter Modus</string>
|
||||
|
@ -467,6 +470,8 @@
|
|||
<string name="download_started">Download gestartet</string>
|
||||
<string name="no_update_available">Kein Update verfügbar</string>
|
||||
<string name="account_status_tor_unavailable">Tor-Netzwerk nicht verfügbar</string>
|
||||
<string name="account_status_bind_failure">Bindungsfehler</string>
|
||||
<string name="account_status_host_unknown">Host unbekannt</string>
|
||||
<string name="server_info_broken">Fehlerhaft</string>
|
||||
<string name="update_info">Pix-Art Messenger prüft auf eine neuere Version. Wenn ein Update verfügbar ist, wirst du gefragt, ob du deine Version aktualisieren möchtest. Der Update Dienst lädt und installiert die neue Version automatisch.\n\nBitte warten…</string>
|
||||
<string name="pref_presence_settings">Status</string>
|
||||
|
@ -485,7 +490,7 @@
|
|||
<string name="fetching_mam_prefs">Archivierungseinstellungen werden abgerufen. Bitte warten …</string>
|
||||
<string name="unable_to_fetch_mam_prefs">Archivierungseinstellungen konnten nicht abgerufen werden</string>
|
||||
<string name="captcha_required">Captcha erforderlich</string>
|
||||
<string name="captcha_hint">Text aus Captcha eintragen</string>
|
||||
<string name="captcha_hint">Gib den Text vom obigen Bild ein</string>
|
||||
<string name="certificate_chain_is_not_trusted">Zertifikat wird nicht vertraut</string>
|
||||
<string name="jid_does_not_match_certificate">Jabber-ID stimmt nicht dem Zertifikat überein</string>
|
||||
<string name="action_renew_certificate">Zertifikat erneuern</string>
|
||||
|
@ -598,4 +603,5 @@
|
|||
<string name="action_end_conversation_muc">Konferenz verlassen</string>
|
||||
<string name="default_resource"></string>
|
||||
<string name="leave_conference_warning">Willst du die Konferenz wirklich verlassen? Du wirst keine neuen Nachrichten mehr bekommen, bis du der Konferenz erneut beitrittst.</string>
|
||||
<string name="show_password">Passwort anzeigen</string>
|
||||
</resources>
|
||||
|
|
Reference in a new issue