Commit cedab7f5 authored by Greyson Parrelli's avatar Greyson Parrelli
Browse files

Fix migration of group names when creating Notification Channels.

parent ca2efcac
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment