From 0c9da27363bc0616bb1212d6651e45c6dcfa4728 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 7 Jul 2021 11:31:16 -0700 Subject: [PATCH] const group handle length --- lib/models/message.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/models/message.dart b/lib/models/message.dart index de53c977..abd06828 100644 --- a/lib/models/message.dart +++ b/lib/models/message.dart @@ -19,6 +19,9 @@ const InviteGroupOverlay = 101; // it will likely be prudent to define a proper Contact wrapper. const TorV3ContactHandleLength = 56; +// Defines the length of a Cwtch v2 Group. +const GroupConversationHandleLength = 32; + abstract class Message { MessageMetadata getMetadata(); Widget getWidget(BuildContext context); @@ -55,7 +58,7 @@ Future messageHandler(BuildContext context, String profileOnion, String var error = messageWrapper['Error'] != null; String? signature; // If this is a group, store the signature - if (contactHandle.length == 32) { + if (contactHandle.length == GroupConversationHandleLength) { signature = messageWrapper['Signature']; } var metadata = MessageMetadata(profileOnion, contactHandle, index, timestamp, senderHandle, senderImage, signature, flags, ackd, error);