private static LinkedList <SignalMessage> InsertIdentityChangedMessages(string number)
        {
            long now = Util.CurrentTimeMillis();
            LinkedList <SignalMessage> messages = new LinkedList <SignalMessage>();

            using (var ctx = new SignalDBContext())
            {
                SignalContact contact = SignalDBContext.GetSignalContactByThreadId(ctx, number);
                if (contact != null)
                {
                    string        str = $"Your safety numbers with {contact.ThreadDisplayName} have changed.";
                    SignalMessage msg = new SignalMessage()
                    {
                        Author            = contact,
                        ComposedTimestamp = now,
                        ReceivedTimestamp = now,
                        Direction         = SignalMessageDirection.Incoming,
                        Type       = SignalMessageType.IdentityKeyChange,
                        ThreadId   = contact.ThreadId,
                        ThreadGuid = contact.ThreadGuid,
                        Content    = new SignalMessageContent()
                        {
                            Content = str
                        }
                    };
                    contact.LastMessage    = msg;
                    contact.MessagesCount += 1;
                    contact.UnreadCount   += 1;
                    ctx.Messages.Add(msg);
                    messages.AddLast(msg);
                    var groups = ctx.GroupMemberships
                                 .Where(gm => gm.ContactId == contact.Id)
                                 .Include(gm => gm.Group);
                    foreach (var gm in groups)
                    {
                        msg = new SignalMessage()
                        {
                            Author            = contact,
                            ComposedTimestamp = now,
                            ReceivedTimestamp = now,
                            Direction         = SignalMessageDirection.Incoming,
                            Type       = SignalMessageType.IdentityKeyChange,
                            ThreadId   = gm.Group.ThreadId,
                            ThreadGuid = gm.Group.ThreadGuid,
                            Content    = new SignalMessageContent()
                            {
                                Content = str
                            }
                        };
                        gm.Group.LastMessage    = msg;
                        gm.Group.MessagesCount += 1;
                        gm.Group.UnreadCount   += 1;
                        ctx.Messages.Add(msg);
                        messages.AddLast(msg);
                    }
                }
                ctx.SaveChanges();
            }
            return(messages);
        }