Search in sources :

Example 1 with TagEmotes

use of chatty.util.api.Emoticons.TagEmotes in project chatty by chatty.

the class ChannelTextPane method printUserMessage.

/**
 * Output a regular message from a user.
 *
 * @param message The object contain all the data
 */
private void printUserMessage(UserMessage message) {
    User user = message.user;
    boolean ignored = message.ignored_compact;
    if (ignored) {
        printCompact("IGNORED", user);
        return;
    }
    Color color = message.color;
    boolean action = message.action;
    String text = message.text;
    TagEmotes emotes = message.emotes;
    boolean highlighted = message.highlighted;
    if (message.whisper && message.action) {
        color = StyleConstants.getForeground(styles.info());
        highlighted = true;
    }
    closeCompactMode();
    MutableAttributeSet style;
    if (highlighted) {
        style = styles.highlight(color);
    } else {
        style = styles.standard(color);
    }
    print(getTimePrefix(), style);
    printUser(user, action, message.whisper, message.id);
    // Change style for text if /me and no highlight (if enabled)
    if (!highlighted && color == null && action && styles.actionColored()) {
        style = styles.standard(user.getDisplayColor());
    }
    printSpecials(text, user, style, emotes, false, message.bits > 0);
    printNewline();
}
Also used : EmoticonUser(chatty.util.api.Emoticon.EmoticonUser) User(chatty.User) TagEmotes(chatty.util.api.Emoticons.TagEmotes)

Aggregations

User (chatty.User)1 EmoticonUser (chatty.util.api.Emoticon.EmoticonUser)1 TagEmotes (chatty.util.api.Emoticons.TagEmotes)1