Projects tigase _server server-core Issues #1433
Handles failure (#1433)
Open
Unknown opened 4 years ago

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){
     }
}
Unknown commented 4 years ago

You are implementing pre-processor, which receives all packets.. Only processors allows for packets filtering using @Handles.

issue 1 of 1
Type
Question
Issue Votes (0)
Watchers (0)
Reference
tigase/_server/server-core#1433
Please wait...
Page is in error, reload to recover