aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2015-04-11 23:00:31 +0200
committersteckbrief <steckbrief@chefmail.de>2015-04-11 23:00:31 +0200
commitdeac0df707099ef7ef6bd2420eb1df13a5a83ca1 (patch)
tree8b087218ad07c5511fe159dbafd5b4be64d23ce1 /src
parent17779e77002e99dabb73f4fa8f9596e9d220319b (diff)
parent82bfd8ac335b84613677ff857cf27c455fdf512d (diff)
Merge branch 'trz/master' of ssh://git.fucktheforce.de/conversations into trz/master
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java6
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java3
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java31
-rw-r--r--src/main/res/values-de/strings.xml6
-rw-r--r--src/main/res/values/strings.xml4
-rw-r--r--src/main/res/xml/preferences.xml6
7 files changed, 38 insertions, 22 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index ca182867..2f3122e7 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2091,6 +2091,10 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
return getPreferences().getBoolean("confirm_messages", true);
}
+ public boolean confirmMessagesRead() {
+ return getPreferences().getBoolean("confirm_read_message", true);
+ }
+
public boolean sendChatStates() {
return getPreferences().getBoolean("chat_states", false);
}
@@ -2167,7 +2171,7 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
public void sendReadMarker(final Conversation conversation) {
final Message markable = conversation.getLatestMarkableMessage();
this.markRead(conversation);
- if (confirmMessages() && markable != null && markable.getRemoteMsgId() != null) {
+ if (confirmMessagesRead() && markable != null && markable.getRemoteMsgId() != null) {
Log.d(Config.LOGTAG, conversation.getAccount().getJid().toBareJid() + ": sending read marker to " + markable.getCounterpart().toString());
Account account = conversation.getAccount();
final Jid to = markable.getCounterpart();
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 82afda07..615926d3 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1052,10 +1052,6 @@ public class ConversationActivity extends XmppActivity
return getPreferences().getBoolean("force_encryption", false);
}
- public boolean useSendButtonToIndicateStatus() {
- return getPreferences().getBoolean("send_button_status", false);
- }
-
public boolean indicateReceived() {
return getPreferences().getBoolean("indicate_received", false);
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 4da9d101..b9a3b8da 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -41,6 +41,7 @@ import java.util.List;
import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentLinkedQueue;
+import de.tzur.conversations.Settings;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.crypto.PgpEngine;
@@ -808,7 +809,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
public void updateSendButton() {
Conversation c = this.conversation;
- if (activity.useSendButtonToIndicateStatus() && c != null
+ if (Settings.SHOW_ONLINE_STATUS && c != null
&& c.getAccount().getStatus() == Account.State.ONLINE) {
if (c.getMode() == Conversation.MODE_SINGLE) {
switch (c.getContact().getMostAvailableStatus()) {
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index fac4cc91..86526040 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -23,6 +23,7 @@ import java.util.concurrent.RejectedExecutionException;
import de.tzur.conversations.Settings;
import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
+import eu.siacs.conversations.entities.Account;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Downloadable;
import eu.siacs.conversations.entities.Message;
@@ -82,22 +83,26 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
TextView mTimestamp = (TextView) view.findViewById(R.id.conversation_lastupdate);
ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage);
- if (Settings.SHOW_ONLINE_STATUS) {
+ if (Settings.SHOW_ONLINE_STATUS && conversation != null && conversation.getAccount().getStatus() == Account.State.ONLINE) {
TextView status = (TextView) view.findViewById(R.id.status);
String color = "#000000";
- switch (conversation.getContact().getMostAvailableStatus()) {
- case Presences.ONLINE:
- case Presences.CHAT:
- color = "#259B23";
- break;
- case Presences.AWAY:
- case Presences.XA:
- color = "#FF9800";
- break;
- case Presences.DND:
- color = "#E51C23";
- break;
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ switch (conversation.getContact().getMostAvailableStatus()) {
+ case Presences.ONLINE:
+ case Presences.CHAT:
+ color = "#259B23";
+ break;
+ case Presences.AWAY:
+ case Presences.XA:
+ color = "#FF9800";
+ break;
+ case Presences.DND:
+ color = "#E51C23";
+ break;
+ }
+ } else if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getMucOptions().online()) {
+ color = "#259B23";
}
status.setBackgroundColor(Color.parseColor(color));
}
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index 5e75f55c..1233817f 100644
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -113,8 +113,10 @@
<string name="pref_advanced_options">Erweiterte Optionen</string>
<string name="pref_never_send_crash">Sende niemals Absturzberichte</string>
<string name="pref_never_send_crash_summary">Wenn du Absturzberichte einschickst, hilfst du Conversations stetig zu verbessern</string>
- <string name="pref_confirm_messages">Lese- und Empfangsbestätigung senden</string>
- <string name="pref_confirm_messages_summary">Informiere deine Kontakte, wenn du eine Nachricht empfangen und gelesen hast</string>
+ <string name="pref_confirm_messages">Empfangsbestätigung senden</string>
+ <string name="pref_confirm_messages_summary">Informiere deine Kontakte, wenn du eine Nachricht empfangen hast</string>
+ <string name="pref_confirm_read_messages">Lesebestätigung senden</string>
+ <string name="pref_confirm_read_messages_summary">Informiere deine Kontakte, wenn du eine Nachricht gelesen hast</string>
<string name="pref_ui_options">Benutzeroberfläche</string>
<string name="pref_parse_emoticons">Smilies ersetzen</string>
<string name="pref_parse_emoticons_summary">Zeige Smilie-Bilder anstelle von Emoticons.</string>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index f6abfc66..2cd67077 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -116,7 +116,9 @@
<string name="pref_never_send_crash">Never send crash reports</string>
<string name="pref_never_send_crash_summary">By sending in stack traces you are helping the ongoing development of Conversations</string>
<string name="pref_confirm_messages">Confirm Messages</string>
- <string name="pref_confirm_messages_summary">Let your contact know when you have received and read a message</string>
+ <string name="pref_confirm_messages_summary">Let your contact know when you have received a message</string>
+ <string name="pref_confirm_read_messages">Confirm Read Messages</string>
+ <string name="pref_confirm_read_messages_summary">Let your contact know when you have read a message</string>
<string name="pref_ui_options">UI Options</string>
<string name="pref_parse_emoticons">Parse Emoticons</string>
<string name="pref_parse_emoticons_summary">Replace emoticons with smilies.</string>
diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml
index a9707e44..206fc6b4 100644
--- a/src/main/res/xml/preferences.xml
+++ b/src/main/res/xml/preferences.xml
@@ -31,6 +31,12 @@
android:title="@string/pref_confirm_messages" />
<CheckBoxPreference
+ android:defaultValue="true"
+ android:key="confirm_read_message"
+ android:summary="@string/pref_confirm_read_messages_summary"
+ android:title="@string/pref_confirm_read_messages" />
+
+ <CheckBoxPreference
android:defaultValue="false"
android:key="chat_states"
android:summary="@string/pref_chat_states_summary"