[jitsi-dev] XMPP eXtensibility should be supported by Jitsi plugin system


#1

Hi,

This message is following the thread "[jitsi-dev] MucRoomJabberImpl fix proposition".
This thread exposed the fact that Jitsi does not provide any way for plugin to add PacketExtension to XMPP message, in order to enhance XEP support for instance.

Here is a temporary workaround that I tested :

In Manifest file "src\net\java\sip\communicator\impl\protocol\jabber\jabber.provider.manifest.mf"
I added at the end :
"Export-Package: net.java.sip.communicator.impl.protocol.jabber,
net.java.sip.communicator.impl.protocol.jabber.extensions"

In Manifest file "src\net\java\sip\communicator\impl\gui\swing.ui.manifest.mf"
I added at the end :
"Export-Package: net.java.sip.communicator.impl.gui.main.chat"

In class file "net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl"

I added the method :

"public void sendInstantMessageWithPacketExtensions(Contact to,
                                                     ContactResource toResource,
                                                     Message message,
                                                     PacketExtension[] packetExtensions) {

    MessageDeliveredEvent msgDelivered =
            sendMessage(to, toResource, message, packetExtensions);

    fireMessageEvent(msgDelivered);

}"

Then I created a plugin component inserted in the CHAT_STATUS_BAR. When the plugin component is requested, it starts a thread that wait for the chat to be rendered, attach a new custom action to the sendButton in order to call this new method above with custom PacketExtensions instances and do everything that has to be done when sending a new Message (clean the writeArea, give it focus again...).

It is working well, but that's obviously not the right way to do this. It has many lacks, like checking that the sending protocol is XMPP, checking the Chat is not a MUCRoom...

Maybe a proposition could be to develop a new OperationSet like OperationSetDefineExtraInformation or something that would be added to Jabber protocol or any protocol that can handle extra data. OperationSetSendBasicInstantMessaging implementations (or any other concerned OperationSet) would be able to fetch it to add those extra information in the message to send.

This is just a quick solution I thought about, I did not study its feasibility...

I would like to know if someone has already done something similar with Jitsi or has already thought about a better way to add extra information to packets before they are send.
Regards,

Pierric
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.