diff --git a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java index da1c4f890b..de885d2be2 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java @@ -261,6 +261,18 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { String displayName = NotificationChannels.getChannelDisplayNameFor(context, systemName, profileName, address); 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); ContentValues values = new ContentValues(1); diff --git a/src/org/thoughtcrime/securesms/recipients/Recipient.java b/src/org/thoughtcrime/securesms/recipients/Recipient.java index a44f9e2598..91ae3e42d1 100644 --- a/src/org/thoughtcrime/securesms/recipients/Recipient.java +++ b/src/org/thoughtcrime/securesms/recipients/Recipient.java @@ -17,7 +17,6 @@ */ package org.thoughtcrime.securesms.recipients; -import android.app.NotificationChannel; import android.content.Context; import android.graphics.drawable.Drawable; import android.net.Uri;