mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
fixed #410 by removing that config option
This commit is contained in:
parent
0ae852a633
commit
97b52abaf9
@ -60,14 +60,6 @@
|
|||||||
android:summary="@string/pref_notification_grace_period_summary"
|
android:summary="@string/pref_notification_grace_period_summary"
|
||||||
android:defaultValue="true"/>
|
android:defaultValue="true"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
|
||||||
android:title="@string/pref_ui_options">
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="use_subject_in_muc"
|
|
||||||
android:title="@string/pref_conference_name"
|
|
||||||
android:summary="@string/pref_conference_name_summary"
|
|
||||||
android:defaultValue="true"/>
|
|
||||||
</PreferenceCategory>
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/pref_advanced_options">
|
android:title="@string/pref_advanced_options">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
|
@ -141,9 +141,8 @@ public class Conversation extends AbstractEntity {
|
|||||||
this.messages = msgs;
|
this.messages = msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName(boolean useSubject) {
|
public String getName() {
|
||||||
if ((getMode() == MODE_MULTI) && (getMucOptions().getSubject() != null)
|
if (getMode() == MODE_MULTI && getMucOptions().getSubject() != null) {
|
||||||
&& useSubject) {
|
|
||||||
return getMucOptions().getSubject();
|
return getMucOptions().getSubject();
|
||||||
} else if (getMode() == MODE_MULTI && bookmark != null
|
} else if (getMode() == MODE_MULTI && bookmark != null
|
||||||
&& bookmark.getName() != null) {
|
&& bookmark.getName() != null) {
|
||||||
|
@ -109,7 +109,7 @@ public class ConferenceDetailsActivity extends XmppActivity {
|
|||||||
break;
|
break;
|
||||||
case R.id.action_edit_subject:
|
case R.id.action_edit_subject:
|
||||||
if (conversation != null) {
|
if (conversation != null) {
|
||||||
quickEdit(conversation.getName(true), new OnValueEdited() {
|
quickEdit(conversation.getName(), new OnValueEdited() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValueEdited(String value) {
|
public void onValueEdited(String value) {
|
||||||
@ -200,7 +200,7 @@ public class ConferenceDetailsActivity extends XmppActivity {
|
|||||||
|
|
||||||
private void populateView() {
|
private void populateView() {
|
||||||
mYourPhoto.setImageBitmap(conversation.getAccount().getImage(this, 48));
|
mYourPhoto.setImageBitmap(conversation.getAccount().getImage(this, 48));
|
||||||
setTitle(conversation.getName(true));
|
setTitle(conversation.getName());
|
||||||
mFullJid.setText(conversation.getContactJid().split("/")[0]);
|
mFullJid.setText(conversation.getContactJid().split("/")[0]);
|
||||||
mYourNick.setText(conversation.getMucOptions().getActualNick());
|
mYourNick.setText(conversation.getMucOptions().getActualNick());
|
||||||
mRoleAffiliaton = (TextView) findViewById(R.id.muc_role);
|
mRoleAffiliaton = (TextView) findViewById(R.id.muc_role);
|
||||||
|
@ -13,7 +13,6 @@ import eu.siacs.conversations.utils.ExceptionHelper;
|
|||||||
import eu.siacs.conversations.utils.UIHelper;
|
import eu.siacs.conversations.utils.UIHelper;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@ -23,7 +22,6 @@ import android.content.DialogInterface;
|
|||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.IntentSender.SendIntentException;
|
import android.content.IntentSender.SendIntentException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.support.v4.widget.SlidingPaneLayout;
|
import android.support.v4.widget.SlidingPaneLayout;
|
||||||
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
|
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
@ -65,8 +63,6 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
private ListView listView;
|
private ListView listView;
|
||||||
|
|
||||||
private boolean paneShouldBeOpen = true;
|
private boolean paneShouldBeOpen = true;
|
||||||
private boolean useSubject = true;
|
|
||||||
private boolean showLastseen = false;
|
|
||||||
private ArrayAdapter<Conversation> listAdapter;
|
private ArrayAdapter<Conversation> listAdapter;
|
||||||
|
|
||||||
private OnConversationUpdate onConvChanged = new OnConversationUpdate() {
|
private OnConversationUpdate onConvChanged = new OnConversationUpdate() {
|
||||||
@ -182,8 +178,7 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
if (ab != null) {
|
if (ab != null) {
|
||||||
ab.setDisplayHomeAsUpEnabled(true);
|
ab.setDisplayHomeAsUpEnabled(true);
|
||||||
ab.setHomeButtonEnabled(true);
|
ab.setHomeButtonEnabled(true);
|
||||||
ab.setTitle(getSelectedConversation().getName(
|
ab.setTitle(getSelectedConversation().getName());
|
||||||
useSubject));
|
|
||||||
}
|
}
|
||||||
invalidateOptionsMenu();
|
invalidateOptionsMenu();
|
||||||
if (!getSelectedConversation().isRead()) {
|
if (!getSelectedConversation().isRead()) {
|
||||||
@ -562,10 +557,6 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
SharedPreferences preferences = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(this);
|
|
||||||
this.useSubject = preferences.getBoolean("use_subject_in_muc", true);
|
|
||||||
this.showLastseen = preferences.getBoolean("show_last_seen", false);
|
|
||||||
if (this.xmppConnectionServiceBound) {
|
if (this.xmppConnectionServiceBound) {
|
||||||
this.onBackendConnected();
|
this.onBackendConnected();
|
||||||
}
|
}
|
||||||
@ -741,15 +732,6 @@ public class ConversationActivity extends XmppActivity {
|
|||||||
listView.invalidateViews();
|
listView.invalidateViews();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showLastseen() {
|
|
||||||
if (getSelectedConversation() == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return this.showLastseen
|
|
||||||
&& getSelectedConversation().getMode() == Conversation.MODE_SINGLE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void runIntent(PendingIntent pi, int requestCode) {
|
public void runIntent(PendingIntent pi, int requestCode) {
|
||||||
try {
|
try {
|
||||||
this.startIntentSenderForResult(pi.getIntentSender(), requestCode,
|
this.startIntentSenderForResult(pi.getIntentSender(), requestCode,
|
||||||
|
@ -26,10 +26,8 @@ import android.content.Context;
|
|||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentSender;
|
import android.content.IntentSender;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.IntentSender.SendIntentException;
|
import android.content.IntentSender.SendIntentException;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.Selection;
|
import android.text.Selection;
|
||||||
import android.view.Gravity;
|
import android.view.Gravity;
|
||||||
@ -67,7 +65,6 @@ public class ConversationFragment extends Fragment {
|
|||||||
private TextView snackbarMessage;
|
private TextView snackbarMessage;
|
||||||
private TextView snackbarAction;
|
private TextView snackbarAction;
|
||||||
|
|
||||||
private boolean useSubject = true;
|
|
||||||
private boolean messagesLoaded = false;
|
private boolean messagesLoaded = false;
|
||||||
|
|
||||||
private IntentSender askForPassphraseIntent = null;
|
private IntentSender askForPassphraseIntent = null;
|
||||||
@ -301,9 +298,6 @@ public class ConversationFragment extends Fragment {
|
|||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
this.activity = (ConversationActivity) getActivity();
|
this.activity = (ConversationActivity) getActivity();
|
||||||
SharedPreferences preferences = PreferenceManager
|
|
||||||
.getDefaultSharedPreferences(activity);
|
|
||||||
this.useSubject = preferences.getBoolean("use_subject_in_muc", true);
|
|
||||||
if (activity.xmppConnectionServiceBound) {
|
if (activity.xmppConnectionServiceBound) {
|
||||||
this.onBackendConnected();
|
this.onBackendConnected();
|
||||||
}
|
}
|
||||||
@ -344,7 +338,7 @@ public class ConversationFragment extends Fragment {
|
|||||||
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
activity.getActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
activity.getActionBar().setHomeButtonEnabled(true);
|
activity.getActionBar().setHomeButtonEnabled(true);
|
||||||
activity.getActionBar().setTitle(
|
activity.getActionBar().setTitle(
|
||||||
conversation.getName(useSubject));
|
conversation.getName());
|
||||||
activity.invalidateOptionsMenu();
|
activity.invalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,7 +384,7 @@ public abstract class XmppActivity extends Activity {
|
|||||||
xmppConnectionService.invite(conversation, contactJid);
|
xmppConnectionService.invite(conversation, contactJid);
|
||||||
}
|
}
|
||||||
Log.d(Config.LOGTAG, "inviting " + contactJid + " to "
|
Log.d(Config.LOGTAG, "inviting " + contactJid + " to "
|
||||||
+ conversation.getName(true));
|
+ conversation.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
|
|||||||
}
|
}
|
||||||
TextView convName = (TextView) view
|
TextView convName = (TextView) view
|
||||||
.findViewById(R.id.conversation_name);
|
.findViewById(R.id.conversation_name);
|
||||||
convName.setText(conv.getName(true));
|
convName.setText(conv.getName());
|
||||||
TextView convLastMsg = (TextView) view
|
TextView convLastMsg = (TextView) view
|
||||||
.findViewById(R.id.conversation_lastmsg);
|
.findViewById(R.id.conversation_lastmsg);
|
||||||
ImageView imagePreview = (ImageView) view
|
ImageView imagePreview = (ImageView) view
|
||||||
|
@ -377,7 +377,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
String name = item.getConversation()
|
String name = item.getConversation()
|
||||||
.getName(true);
|
.getName();
|
||||||
String read = getContext()
|
String read = getContext()
|
||||||
.getString(
|
.getString(
|
||||||
R.string.contact_has_read_up_to_this_point,
|
R.string.contact_has_read_up_to_this_point,
|
||||||
|
@ -215,7 +215,7 @@ public class UIHelper {
|
|||||||
List<User> members = conversation.getMucOptions().getUsers();
|
List<User> members = conversation.getMucOptions().getUsers();
|
||||||
if (members.size() == 0) {
|
if (members.size() == 0) {
|
||||||
return getUnknownContactPicture(
|
return getUnknownContactPicture(
|
||||||
new String[] { conversation.getName(false) }, size,
|
new String[] { conversation.getName() }, size,
|
||||||
bgColor, fgColor);
|
bgColor, fgColor);
|
||||||
}
|
}
|
||||||
ArrayList<String> names = new ArrayList<String>();
|
ArrayList<String> names = new ArrayList<String>();
|
||||||
@ -332,7 +332,6 @@ public class UIHelper {
|
|||||||
|
|
||||||
SharedPreferences preferences = PreferenceManager
|
SharedPreferences preferences = PreferenceManager
|
||||||
.getDefaultSharedPreferences(context);
|
.getDefaultSharedPreferences(context);
|
||||||
boolean useSubject = preferences.getBoolean("use_subject_in_muc", true);
|
|
||||||
boolean showNofifications = preferences.getBoolean("show_notification",
|
boolean showNofifications = preferences.getBoolean("show_notification",
|
||||||
true);
|
true);
|
||||||
boolean vibrate = preferences.getBoolean("vibrate_on_notification",
|
boolean vibrate = preferences.getBoolean("vibrate_on_notification",
|
||||||
@ -381,7 +380,7 @@ public class UIHelper {
|
|||||||
Conversation conversation = unread.get(0);
|
Conversation conversation = unread.get(0);
|
||||||
targetUuid = conversation.getUuid();
|
targetUuid = conversation.getUuid();
|
||||||
mBuilder.setLargeIcon(conversation.getImage(context, 64));
|
mBuilder.setLargeIcon(conversation.getImage(context, 64));
|
||||||
mBuilder.setContentTitle(conversation.getName(useSubject));
|
mBuilder.setContentTitle(conversation.getName());
|
||||||
if (notify) {
|
if (notify) {
|
||||||
mBuilder.setTicker(conversation.getLatestMessage()
|
mBuilder.setTicker(conversation.getLatestMessage()
|
||||||
.getReadableBody(context));
|
.getReadableBody(context));
|
||||||
@ -413,12 +412,12 @@ public class UIHelper {
|
|||||||
for (int i = 0; i < unread.size(); ++i) {
|
for (int i = 0; i < unread.size(); ++i) {
|
||||||
targetUuid = unread.get(i).getUuid();
|
targetUuid = unread.get(i).getUuid();
|
||||||
if (i < unread.size() - 1) {
|
if (i < unread.size() - 1) {
|
||||||
names.append(unread.get(i).getName(useSubject) + ", ");
|
names.append(unread.get(i).getName() + ", ");
|
||||||
} else {
|
} else {
|
||||||
names.append(unread.get(i).getName(useSubject));
|
names.append(unread.get(i).getName());
|
||||||
}
|
}
|
||||||
style.addLine(Html.fromHtml("<b>"
|
style.addLine(Html.fromHtml("<b>"
|
||||||
+ unread.get(i).getName(useSubject)
|
+ unread.get(i).getName()
|
||||||
+ "</b> "
|
+ "</b> "
|
||||||
+ unread.get(i).getLatestMessage()
|
+ unread.get(i).getLatestMessage()
|
||||||
.getReadableBody(context)));
|
.getReadableBody(context)));
|
||||||
|
Loading…
Reference in New Issue
Block a user