public static string GetMessageHeaderText(Message message, User user, User user2) { if (!string.IsNullOrWhiteSpace(message.body)) { string input = BrowserNavigationService.Regex_DomainMention.Replace(message.body, "[$2|$4]"); return(BrowserNavigationService.Regex_Mention.Replace(input, "$4")); } if (!string.IsNullOrWhiteSpace(message.action)) { return(SystemMessageTextHelper.GenerateText(message, user, user2, false)); } if (message.attachments != null && message.attachments.Count > 0) { Attachment firstAttachment = message.attachments.First <Attachment>(); int num = message.attachments.Count <Attachment>((Func <Attachment, bool>)(a => a.type == firstAttachment.type)); string lowerInvariant = firstAttachment.type.ToLowerInvariant(); if (lowerInvariant == "money_transfer") { return(CommonResources.MoneyTransfer); } else if (lowerInvariant == "link") { return(CommonResources.Link); } else if (lowerInvariant == "wall") { return(CommonResources.Conversation_WallPost); } else if (lowerInvariant == "gift") { return(CommonResources.Gift); } else if (lowerInvariant == "photo") { if (num == 1) { return(CommonResources.Conversations_OnePhoto); } if (num < 5) { return(string.Format(CommonResources.Conversations_TwoFourPhotosFrm, num)); } return(string.Format(CommonResources.Conversations_FiveOrMorePhotosFrm, num)); } else if (lowerInvariant == "wall_reply") { return(CommonResources.Comment); } else if (lowerInvariant == "sticker") { return(CommonResources.Conversation_Sticker); } else if (lowerInvariant == "market") { return(CommonResources.Product); } else if (lowerInvariant == "doc") { Doc doc1 = firstAttachment.doc; if ((doc1 != null ? (doc1.IsGraffiti ? 1 : 0) : 0) != 0) { return(CommonResources.Graffiti); } Doc doc2 = firstAttachment.doc; if ((doc2 != null ? (doc2.IsVoiceMessage ? 1 : 0) : 0) != 0) { return(CommonResources.VoiceMessage); } if (num == 1) { return(CommonResources.Conversations_OneDocument); } if (num < 5) { return(string.Format(CommonResources.Conversations_TwoFourDocumentsFrm, num)); } return(string.Format(CommonResources.Conversations_FiveMoreDocumentsFrm, num)); } else if (lowerInvariant == "audio") { if (num == 1) { return(CommonResources.Conversations_OneAudio); } if (num < 5) { return(string.Format(CommonResources.Conversations_TwoFourAudioFrm, num)); } return(string.Format(CommonResources.Conversations_FiveOrMoreAudioFrm, num)); } else if (lowerInvariant == "video") { if (num == 1) { return(CommonResources.Conversations_OneVideo); } if (num < 5) { return(string.Format(CommonResources.Conversations_TwoFourVideosFrm, num)); } return(string.Format(CommonResources.Conversations_FiveOrMoreVideosFrm, num)); } } if (message.geo != null) { return(CommonResources.Conversations_Location); } if (message.fwd_messages == null || message.fwd_messages.Count <= 0) { return(string.Empty); } int count = message.fwd_messages.Count; if (count == 1) { return(CommonResources.Conversations_OneForwardedMessage); } if (count < 5) { return(string.Format(CommonResources.Conversations_TwoFourForwardedMessagesFrm, count)); } return(string.Format(CommonResources.Conversations_FiveMoreForwardedMessagesFrm, count)); }