I implements XMPPPreprocessorIfc, and I use Handles 。 In this example, the plugin is interested only in packets with elements and only if they are in the "jabber:client" namespace。
issue: but I get all packets, not merely message。 Why?
code
@Id("haici-preprocessor") @Handles({@Handle( path = {"message"}, xmlns = "jabber:client" )}) public class HaiciPreprocessorPlugin extends AnnotatedXMPPProcessor implements XMPPPreprocessorIfc, RegistrarBean { public boolean preProcess(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) { } } config.tdsl: 'sess-man' { 'haici-preprocessor' (class: com.gzhc365.im.tigase.preprocessor.HaiciPreprocessorPlugin,active: true){ } }
You are implementing pre-processor, which receives all packets.. Only processors allows for packets filtering using @Handles.
@Handles
I implements XMPPPreprocessorIfc, and I use Handles 。 In this example, the plugin is interested only in packets with elements and only if they are in the "jabber:client" namespace。
issue: but I get all packets, not merely message。 Why?
code