mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +00:00
Fix migration of group names when creating Notification Channels.
This commit is contained in:
parent
ca2efcac8a
commit
cedab7f504
@ -261,6 +261,18 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
|||||||
String displayName = NotificationChannels.getChannelDisplayNameFor(context, systemName, profileName, address);
|
String displayName = NotificationChannels.getChannelDisplayNameFor(context, systemName, profileName, address);
|
||||||
boolean vibrateEnabled = vibrateState == 0 ? TextSecurePreferences.isNotificationVibrateEnabled(context) : vibrateState == 1;
|
boolean vibrateEnabled = vibrateState == 0 ? TextSecurePreferences.isNotificationVibrateEnabled(context) : vibrateState == 1;
|
||||||
|
|
||||||
|
if (address.isGroup()) {
|
||||||
|
try(Cursor groupCursor = db.rawQuery("SELECT title FROM groups WHERE group_id = ?", new String[] { address.toGroupString() })) {
|
||||||
|
if (groupCursor != null && groupCursor.moveToFirst()) {
|
||||||
|
String title = groupCursor.getString(groupCursor.getColumnIndexOrThrow("title"));
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(title)) {
|
||||||
|
displayName = title;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String channelId = NotificationChannels.createChannelFor(context, address, displayName, messageSoundUri, vibrateEnabled);
|
String channelId = NotificationChannels.createChannelFor(context, address, displayName, messageSoundUri, vibrateEnabled);
|
||||||
|
|
||||||
ContentValues values = new ContentValues(1);
|
ContentValues values = new ContentValues(1);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.thoughtcrime.securesms.recipients;
|
package org.thoughtcrime.securesms.recipients;
|
||||||
|
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
Loading…
Reference in New Issue
Block a user