@@ -138,7 +138,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
138138 .setSmallIcon(android.R .drawable.sym_action_chat)
139139 .setContentTitle(contact.name.ifEmpty { context.getText(R .string.contact_default_name) })
140140 .setContentText(message)
141- .setContentIntent(deepLinkToChat(PublicKey ( contact.publicKey) ))
141+ .setContentIntent(deepLinkToChat(contact.publicKey))
142142 .setAutoCancel(true )
143143 .setSilent(silent)
144144
@@ -151,13 +151,15 @@ class NotificationHelper @Inject constructor(private val context: Context) {
151151
152152 val chatPartner = Person .Builder ()
153153 .setName(contact.name.ifEmpty { context.getText(R .string.contact_default_name) })
154- .setKey(if (outgoing) " myself" else contact.publicKey)
154+ .setKey(if (outgoing) " myself" else contact.publicKey.string() )
155155 .setIcon(icon)
156156 .setImportant(true )
157157 .build()
158158
159159 val style =
160- notifierOld.activeNotifications.find { it.notification.group == contact.publicKey }?.notification?.let {
160+ notifierOld.activeNotifications.find {
161+ it.notification.group == contact.publicKey.string()
162+ }?.notification?.let {
161163 NotificationCompat .MessagingStyle .extractMessagingStyleFromNotification(it)
162164 } ? : NotificationCompat .MessagingStyle (chatPartner)
163165
@@ -167,7 +169,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
167169
168170 notificationBuilder
169171 .setStyle(style)
170- .setGroup(contact.publicKey)
172+ .setGroup(contact.publicKey.string() )
171173 }
172174
173175 // I can't find it in the documentation for RemoteInput or anything, but per
@@ -182,7 +184,10 @@ class NotificationHelper @Inject constructor(private val context: Context) {
182184 PendingIntentCompat .getBroadcast(
183185 context,
184186 contact.publicKey.hashCode(),
185- Intent (context, ActionReceiver ::class .java).putExtra(KEY_CONTACT_PK , contact.publicKey),
187+ Intent (context, ActionReceiver ::class .java).putExtra(
188+ KEY_CONTACT_PK ,
189+ contact.publicKey.string(),
190+ ),
186191 PendingIntent .FLAG_UPDATE_CURRENT ,
187192 mutable = true ,
188193 ),
@@ -202,7 +207,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
202207 .Builder (
203208 IconCompat .createWithResource(context, R .drawable.ic_send),
204209 context.getString(R .string.reply),
205- deepLinkToChat(PublicKey ( contact.publicKey) , focusMessageBox = true ),
210+ deepLinkToChat(contact.publicKey, focusMessageBox = true ),
206211 )
207212 .setSemanticAction(NotificationCompat .Action .SEMANTIC_ACTION_REPLY )
208213 .build(),
@@ -217,7 +222,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
217222 context,
218223 " ${contact.publicKey} _mark_as_read" .hashCode(),
219224 Intent (context, ActionReceiver ::class .java)
220- .putExtra(KEY_CONTACT_PK , contact.publicKey)
225+ .putExtra(KEY_CONTACT_PK , contact.publicKey.string() )
221226 .putExtra(KEY_ACTION , Action .MarkAsRead ),
222227 PendingIntent .FLAG_UPDATE_CURRENT ,
223228 ),
@@ -266,7 +271,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
266271 return
267272 }
268273
269- dismissCallNotification(PublicKey ( contact.publicKey) )
274+ dismissCallNotification(contact.publicKey)
270275 val notificationBuilder = NotificationCompat .Builder (context, CALL )
271276 .setCategory(NotificationCompat .CATEGORY_CALL )
272277 .setSmallIcon(android.R .drawable.ic_menu_call)
@@ -282,8 +287,8 @@ class NotificationHelper @Inject constructor(private val context: Context) {
282287 .setContentIntent(
283288 NavDeepLinkBuilder (context)
284289 .setGraph(R .navigation.nav_graph)
285- .addDestination(R .id.chatFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey))
286- .addDestination(R .id.callFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey))
290+ .addDestination(R .id.chatFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey.string() ))
291+ .addDestination(R .id.callFragment, bundleOf(CONTACT_PUBLIC_KEY to contact.publicKey.string() ))
287292 .createPendingIntent(),
288293 )
289294 .addAction(
@@ -295,7 +300,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
295300 context,
296301 " ${contact.publicKey} _end_call" .hashCode(),
297302 Intent (context, ActionReceiver ::class .java)
298- .putExtra(KEY_CONTACT_PK , contact.publicKey)
303+ .putExtra(KEY_CONTACT_PK , contact.publicKey.string() )
299304 .putExtra(KEY_ACTION , Action .CallEnd ),
300305 PendingIntent .FLAG_UPDATE_CURRENT ,
301306 ),
@@ -323,7 +328,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
323328 .setSmallIcon(android.R .drawable.ic_menu_call)
324329 .setContentTitle(context.getString(R .string.incoming_call))
325330 .setContentText(context.getString(R .string.incoming_call_from, c.name))
326- .setContentIntent(deepLinkToChat(PublicKey ( c.publicKey) ))
331+ .setContentIntent(deepLinkToChat(c.publicKey))
327332 .addAction(
328333 NotificationCompat .Action
329334 .Builder (
@@ -333,7 +338,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
333338 context,
334339 " ${c.publicKey} _accept_call" .hashCode(),
335340 Intent (context, ActionReceiver ::class .java)
336- .putExtra(KEY_CONTACT_PK , c.publicKey)
341+ .putExtra(KEY_CONTACT_PK , c.publicKey.string() )
337342 .putExtra(KEY_ACTION , Action .CallAccept ),
338343 PendingIntent .FLAG_UPDATE_CURRENT ,
339344 ),
@@ -350,7 +355,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
350355 context,
351356 " ${c.publicKey} _reject_call" .hashCode(),
352357 Intent (context, ActionReceiver ::class .java)
353- .putExtra(KEY_CONTACT_PK , c.publicKey)
358+ .putExtra(KEY_CONTACT_PK , c.publicKey.string() )
354359 .putExtra(KEY_ACTION , Action .CallReject ),
355360 PendingIntent .FLAG_UPDATE_CURRENT ,
356361 ),
@@ -362,7 +367,7 @@ class NotificationHelper @Inject constructor(private val context: Context) {
362367 context,
363368 " ${c.publicKey} _ignore_call" .hashCode(),
364369 Intent (context, ActionReceiver ::class .java)
365- .putExtra(KEY_CONTACT_PK , c.publicKey)
370+ .putExtra(KEY_CONTACT_PK , c.publicKey.string() )
366371 .putExtra(KEY_ACTION , Action .CallIgnore ),
367372 PendingIntent .FLAG_UPDATE_CURRENT ,
368373 ),
0 commit comments