Init notifications for deaddrop.

This commit is contained in:
B. Petersen
2017-10-28 18:37:32 +02:00
parent 48684bded4
commit 97da31ae2d
4 changed files with 8 additions and 6 deletions
@@ -203,9 +203,10 @@ public class ApplicationLoader extends Application {
// make sure, the notifications for the "deaddrop" dialog are muted by default
SharedPreferences notificationPreferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
if( notificationPreferences.getInt("notify2_"+MrChat.MR_CHAT_ID_DEADDROP, 666)==666 ) {
if( notificationPreferences.getInt("deaddrop_initialized", 0)!=1 ) {
SharedPreferences.Editor editor = notificationPreferences.edit();
editor.putInt("notify2_"+MrChat.MR_CHAT_ID_DEADDROP, 2);
editor.putInt("deaddrop_initialized", 1);
editor.apply();
}
@@ -593,8 +593,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
headerItem.addSubItem(ID_ATTACH, context.getString(R.string.AttachFiles), 0); // "Attach" means "Attach to chat", not "Attach to message" (which is not possible)
}
//if( !m_isChatWithDeaddrop || m_isDeaddropInChatlist ) { -- we can disable this at a later time, for now, it may be handy to have all options
headerItem.addSubItem(ID_SHOW_PROFILE, context.getString(R.string.ViewProfile), 0);
if( !m_isChatWithDeaddrop ) {
headerItem.addSubItem(ID_SHOW_PROFILE, context.getString(R.string.ViewProfile), 0);
}
if( !m_isChatWithDeaddrop ) {
headerItem.addSubItem(ID_DELETE_CHAT, context.getString(R.string.DeleteChat), 0);
@@ -830,7 +830,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
emptyRow = rowCount++;
if( (chat_id!=0 && (chat_id!=MrChat.MR_CHAT_ID_DEADDROP || MrMailbox.getConfigInt("show_deaddrop", 0)!=0))
if( (chat_id!=0 /*&& (chat_id!=MrChat.MR_CHAT_ID_DEADDROP || MrMailbox.getConfigInt("show_deaddrop", 0)!=0)*/)
|| MrMailbox.getChatIdByContactId(user_id)!=0 ) {
settingsNotificationsRow = rowCount++;
}
@@ -111,7 +111,7 @@ public class SettingsAdvFragment extends BaseFragment implements NotificationCen
}
autoplayGifsRow = rowCount++;
textSizeRow = rowCount++; // for now, we have the font size in the advanced settings; this is because the numberical selection is a little bit weird and does only affect the message text. It would be better to use the font size defined by the system with "sp" (Scale-independent Pixels which included the user's font size preference)
showUnknownSendersRow = rowCount++;
showUnknownSendersRow = -1;// rowCount++;
sendByEnterRow = rowCount++;
raiseToSpeakRow = rowCount++; // outgoing message
cacheRow = -1;// for now, the - non-functional - page is reachable by the "storage settings" in the "android App Settings" only
@@ -212,7 +212,7 @@ public class SettingsAdvFragment extends BaseFragment implements NotificationCen
// if showing deaddrop is disabled, also disable notifications for this chat (cannot be displayed otherwise)
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE);
SharedPreferences.Editor editor = preferences.edit();
editor.putInt("notify2_" + MrChat.MR_CHAT_ID_DEADDROP, oldval==1? 2 /*always muted*/ : 0);
editor.putInt("notify2_" + MrChat.MR_CHAT_ID_DEADDROP, oldval==1? 2 : 0);
editor.apply();
}
else if(i==e2eEncryptionRow )