[jitsi-dev] Access to the XMPPConnection from the Plugin


Hi All!

We're going to create a plugin for Jitsi to improve user experience of
Jabber protocol.
Our plugin will implement acknowledgment of all outgoing messages that
received by server.

We are faced to losing outgoing messages, in case of local network
malfunction. In these cases real network connection is not working, but
Jitsi keep it's connection online till keep-alive timeout occurs.
In this time window all outgoing messages are lost without any warning.
Only when timeout event occurs, and Jitsi obtains a connection lost status -
the warning shows and describes that this outgoing message can not be
delivered. But all messages before this last message was already lost
without any warning.

The plugin will partially implement XEP-198 (without session resumption,
but this XEP allows it) and improve behavior on servers without XEP-198

Due to the the fact that the lost messages can be life threatening, our
plugin will implement this algorithm (when activated):
-Plugin will buffer the all outgoing messages and then confirm an
acknowledgment from the server.
-If server support XEP-198 Stream Management, the plugin will ask an
acknowledgment of all outgoing messages from the server according to
XEP-198. After acknowledgment is recieved - this message will be deleted
from the buffer.
-If server does not support XEP-198, the plugin will make attempt to ping
server with XEP-199 ping request after the message was sent. On any server
answer (pong or error "not implemented") - the message will be deleted from
the buffer.
-Plugin will resends all the messages in the buffer (in case if it is not
clean) on all Jabber events of Reconnect (REGISTERED).
-Plugin will saves outgoing buffer on application close and restores in
state on starting.

We have already tested this algorithm by hardcoding it in Jitsi source code
of the test build. Everything is fine and works properly.
For now we want to create an separate plugin to community and publish it in
the right way, without modification of the Jitsi's core sources.
But faced a big problem:
Our plugin requires XMPPConnection object of all Jabber's service providers
to adding several Packet Listener.
This object applicable only to ProtocolProviderServiceJabberImpl class
(getConnection method). But it's not accessable from plugin module.
All the tries to import this class is not working coz there is no packages
that exports it.
The one way to import it from a plugin - to add a string
Export-Package: net.java.sip.communicator.impl.protocol.jabber

We believe that the way of making these changes directly in the
implementation of the protocol is absolutely incorrect, and the only right
one - to build this algorithm in a separate plugin, perhaps attached to the
product distribution.
In this way, we ask you to make these changes in the manifest file, so that
we can continue to improve the Jitsi project. Or at least we're waiting of
advice from you.

Thank You.