Class MessageTagUtils

java.lang.Object
com.restfb.util.MessageTagUtils

public final class MessageTagUtils extends Object
Helper to transform a Graph API message + message_tags pair into a normalized representation that uses the mention syntax (e.g. @[12345]).
  • Method Details

    • normalizeMessage

      public static String normalizeMessage(String message, List<MessageTag> tags)
      Rebuilds a message so that tagged segments are replaced by their mention syntax.
      Parameters:
      message - original text returned by the Graph API
      tags - message tags as returned by the Graph API
      Returns:
      the normalized message or the original one if the tags don't provide enough information