package me.rkfg.xmpp.bot.plugins;

import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Message.Type;
import org.jivesoftware.smack.util.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class MessagePluginImpl implements MessagePlugin {
    protected Logger log = LoggerFactory.getLogger(getClass());

    protected String getNick(Message message) {
        return StringUtils.parseResource(message.getFrom());
    }

    protected boolean isMessageFromUser(Message message) {
        return !getNick(message).isEmpty();
    }

    protected String getAppeal(Message message, String target) {
        return message.getType() == Type.groupchat ? target + ", " : "";
    }

    protected String getAppeal(Message message) {
        return getAppeal(message, StringUtils.parseResource(message.getFrom()));
    }

    @Override
    public void init() {
        // do nothing by default
    }

    @Override
    public String getManual() {
        return "справка по плагину отсутствует.";
    }
}

@@ -369,32 +369,38 @@
 %0A%0A    protected 
+final 
 String getNick(M
@@ -477,32 +477,164 @@
 From());%0A    %7D%0A%0A
+    protected final String getBareAddress(Message message) %7B%0A        return StringUtils.parseBareAddress(message.getFrom());%0A    %7D%0A%0A
     protected bo

Add service methods to MessagePluginImpl.