[jitsi-dev] How to approach private message support (volatile contact?)


#1

Hi,

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and message was: null
java.lang.NullPointerException
    at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
    at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
    at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
    at
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
    at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
    at java.awt.Component.processMouseEvent(Component.java:6508)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
    at
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
    at java.awt.Component.processEvent(Component.java:6270)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4861)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4687)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
    at java.awt.EventQueue.access$200(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:688)
    at java.awt.EventQueue$3.run(EventQueue.java:686)
    at java.security.AccessController.doPrivileged(Native Method)
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.awt.EventQueue$4.run(EventQueue.java:702)
    at java.awt.EventQueue$4.run(EventQueue.java:700)
    at java.security.AccessController.doPrivileged(Native Method)
    at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
    at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


#2

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I'm not too savvy on all the contact stuff, but if you follow the whole
volatile contact creation for Jabber, you eventually end up in the
OpSetPersistentPresence that fires a SUBSCRIPTION_CREATED event. This is
intercepted by the MetaContactList service and it creates the volatile
MetaContact for you.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

As small as possible in general is good, you can always add needed stuff
later on if you notice something is missing.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

Ingo


#3

Hi Danny,

In the jabber implementation when we are creating volatile contact we call ServerStoredContactListJabberImpl.fireContactAdded method which fires subscription create event. MetaContactListServiceImpl.ContactListSubscriptionListener.subscriptionCreated method receives that event and creates the meta contact. That’s how the meta contact is created in the jabber implementation.

If you don’t want to follow the jabber implementation completely I think you can put all needed implementation in your ChatRoom class. You must create a SourceContact instance if it is not created yet and then create meta contact for it . For creating the meta contact you can refer to ServerStoredContactListJabberImpl.createVolatileContact and fire the same events. You should also add Source Contact to the not in contact list group and create it if it doesn’t exists. Maybe you will need a class for the group.

I hope this helps. If you need more help or if you have any questions don’t hesitate to ask me.

Regards,
Hristo.

···

On Dec 29, 2013, at 1:28 AM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

Hi,

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and message was: null
java.lang.NullPointerException
   at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
   at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
   at
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
   at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
   at java.awt.Component.processMouseEvent(Component.java:6508)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
   at
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
   at java.awt.Component.processEvent(Component.java:6270)
   at java.awt.Container.processEvent(Container.java:2229)
   at java.awt.Component.dispatchEventImpl(Component.java:4861)
   at java.awt.Container.dispatchEventImpl(Container.java:2287)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
   at java.awt.Container.dispatchEventImpl(Container.java:2273)
   at java.awt.Window.dispatchEventImpl(Window.java:2719)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
   at java.awt.EventQueue.access$200(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:688)
   at java.awt.EventQueue$3.run(EventQueue.java:686)
   at java.security.AccessController.doPrivileged(Native Method)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
   at java.awt.EventQueue$4.run(EventQueue.java:702)
   at java.awt.EventQueue$4.run(EventQueue.java:700)
   at java.security.AccessController.doPrivileged(Native Method)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
   at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
   at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
   at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#4

Hi Hristo,

Thanks. I will look into that next.

My current implementation uses a chat room with only 1 other member.
(Incidentally I noticed that the original IRC implementation used the same
approach.)
There are some drawbacks though. You cannot initiate a private chat
conversation by double-clicking the member in a chat room, but it should be
enough for a first implementation. For now it is possible to initiate a
private conversation with '/msg <membername> <first message>' as other IRC
clients. (Also OTR is not applicable on chat rooms, so this option is off
the table for now too.)

I got the impression that in order to double-click a chat room member I had
to implement support for Persistent Presence. If your suggestion works,
that should make it a lot simpler, which I like :-).

Thanks!
Danny

···

On Tue, Jan 7, 2014 at 10:59 AM, Hristo Terezov <hristo@sip-communicator.org > wrote:

Hi Danny,

In the jabber implementation when we are creating volatile contact we call
ServerStoredContactListJabberImpl.fireContactAdded method which fires
subscription create event.
MetaContactListServiceImpl.ContactListSubscriptionListener.subscriptionCreated
method receives that event and creates the meta contact. That’s how the
meta contact is created in the jabber implementation.

If you don’t want to follow the jabber implementation completely I think
you can put all needed implementation in your ChatRoom class. You must
create a SourceContact instance if it is not created yet and then create
meta contact for it . For creating the meta contact you can refer to
ServerStoredContactListJabberImpl.createVolatileContact and fire the same
events. You should also add Source Contact to the not in contact list group
and create it if it doesn’t exists. Maybe you will need a class for the
group.

I hope this helps. If you need more help or if you have any questions
don’t hesitate to ask me.

Regards,
Hristo.

On Dec 29, 2013, at 1:28 AM, Danny van Heumen <danny@dannyvanheumen.nl> > wrote:

> Hi,
>
> I'm currently looking into supporting private messages. My first
> attempts are to send a private message by double clicking on a chat room
> contact, hoping that a "private messaging"-window will open. The first
> exception I got had to do with some unimplemented parts of the
> interface. I now have a *very* limited "ContactIrcImpl" class in order
> to provide the required implementation, however I quickly get stuck on
> the next step, which is to acquire a corresponding MetaContact instance.
>
> I have been looking at this infrastructure, but I don't quite get how
> this is meant to work.
>
> The Jabber implementation accesses an OperationSetPersistentPresence
> instance in order to acquire a volatile contact which is either created
> or retrieved from a notInContactListGroup.
>
> I would appreciate any hints on how to approach the implementation. I
> could "recreate" Jabber's implementation however it seems like that
> there is support for many more features there that are not required. On
> the other hand, I am not quite sure if it's okay to do a "smallest
> possible implementation" which may come back to haunt me in the future.
>
> This stack trace is my attempt at "private messaging" with the currently
> skeleton implementation. I am aware that you do not have all the code,
> however the problems originates from Jitsi itself. In the method
> 'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
> currently just returns null.
>
> Thanks!
>
>
> 00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
> uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
> and message was: null
> java.lang.NullPointerException
> at
>
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
> at
>
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
> at
>
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
> at
>
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
> at
> java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
> at java.awt.Component.processMouseEvent(Component.java:6508)
> at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
> at
>
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
> at java.awt.Component.processEvent(Component.java:6270)
> at java.awt.Container.processEvent(Container.java:2229)
> at java.awt.Component.dispatchEventImpl(Component.java:4861)
> at java.awt.Container.dispatchEventImpl(Container.java:2287)
> at java.awt.Component.dispatchEvent(Component.java:4687)
> at
> java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
> at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
> at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
> at java.awt.Container.dispatchEventImpl(Container.java:2273)
> at java.awt.Window.dispatchEventImpl(Window.java:2719)
> at java.awt.Component.dispatchEvent(Component.java:4687)
> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
> at java.awt.EventQueue.access$200(EventQueue.java:103)
> at java.awt.EventQueue$3.run(EventQueue.java:688)
> at java.awt.EventQueue$3.run(EventQueue.java:686)
> at java.security.AccessController.doPrivileged(Native Method)
> at
>
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
> at
>
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
> at java.awt.EventQueue$4.run(EventQueue.java:702)
> at java.awt.EventQueue$4.run(EventQueue.java:700)
> at java.security.AccessController.doPrivileged(Native Method)
> at
>
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
> at
>
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
> at
>
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
> at
>
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
> at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
> at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
>
>
>
> _______________________________________________
> dev mailing list
> dev@jitsi.org
> Unsubscribe instructions and other list options:
> http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#5

Hi Devs, Hristo,

Okay ... so I have been fiddling around a bit with
OpSetPersistentPresence and I got something *very* preliminary working.
Enough to discover that I do need OpSetBasicInstantMessaging, which
isn't that much of a surprise, actually, just good to have confirmation.
But I also discovered something else ...

Every contact that isn't already in the list is supposed to be added as
a contact in the group "Not In Contact List" (or something like that).
... I don't think you'll like that behavior with IRC channels. I joined
2 pretty crowded channels and there were over 4000 contacts in this
group ... (and then Jitsi froze which is probably due to the incomplete
implementation).

I don't think that this is the right approach for IRC chat room members
... I am going to have a look at how I might do without the contact
list, but that could be tricky.

Regards,
Danny

PS: I know that Hristo already explained about adding to the contact
list, but sometimes you just have to see in order to know the exact
behavior and impact. :slight_smile:

···

On 01/07/2014 10:59 AM, Hristo Terezov wrote:

Hi Danny,

In the jabber implementation when we are creating volatile contact we call ServerStoredContactListJabberImpl.fireContactAdded method which fires subscription create event. MetaContactListServiceImpl.ContactListSubscriptionListener.subscriptionCreated method receives that event and creates the meta contact. That�s how the meta contact is created in the jabber implementation.

If you don�t want to follow the jabber implementation completely I think you can put all needed implementation in your ChatRoom class. You must create a SourceContact instance if it is not created yet and then create meta contact for it . For creating the meta contact you can refer to ServerStoredContactListJabberImpl.createVolatileContact and fire the same events. You should also add Source Contact to the not in contact list group and create it if it doesn�t exists. Maybe you will need a class for the group.

I hope this helps. If you need more help or if you have any questions don�t hesitate to ask me.

Regards,
Hristo.

On Dec 29, 2013, at 1:28 AM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

Hi,

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and message was: null
java.lang.NullPointerException
   at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
   at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
   at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
   at
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
   at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
   at java.awt.Component.processMouseEvent(Component.java:6508)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
   at
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
   at java.awt.Component.processEvent(Component.java:6270)
   at java.awt.Container.processEvent(Container.java:2229)
   at java.awt.Component.dispatchEventImpl(Component.java:4861)
   at java.awt.Container.dispatchEventImpl(Container.java:2287)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
   at java.awt.Container.dispatchEventImpl(Container.java:2273)
   at java.awt.Window.dispatchEventImpl(Window.java:2719)
   at java.awt.Component.dispatchEvent(Component.java:4687)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
   at java.awt.EventQueue.access$200(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:688)
   at java.awt.EventQueue$3.run(EventQueue.java:686)
   at java.security.AccessController.doPrivileged(Native Method)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
   at java.awt.EventQueue$4.run(EventQueue.java:702)
   at java.awt.EventQueue$4.run(EventQueue.java:700)
   at java.security.AccessController.doPrivileged(Native Method)
   at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
   at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
   at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
   at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#6

Hi Danny,

Hi Devs, Hristo,

Okay ... so I have been fiddling around a bit with
OpSetPersistentPresence and I got something *very* preliminary working.
Enough to discover that I do need OpSetBasicInstantMessaging, which
isn't that much of a surprise, actually, just good to have confirmation.
But I also discovered something else …

Are you planning to use the OpSetBasicInstantMessaging for the private messaging?
In general it is not required to have OpSetBasicInstantMessaging if you have OpSetPersistentPresence (I don’t think that OpSetPersistentPresence service uses explicitly OpSetBasicInstantMessaging ).

Every contact that isn't already in the list is supposed to be added as
a contact in the group "Not In Contact List" (or something like that).
... I don't think you'll like that behavior with IRC channels. I joined
2 pretty crowded channels and there were over 4000 contacts in this
group ... (and then Jitsi froze which is probably due to the incomplete
implementation).

Do you mean you are adding in the contact list all the members in the IRC channel that was joined? In the jabber implementation we add member of the chat room in the “Not In Contact List” group only if the private messaging conversation has been started.

···

On Apr 13, 2014, at 4:08 PM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

I don't think that this is the right approach for IRC chat room members
... I am going to have a look at how I might do without the contact
list, but that could be tricky.

Regards,
Danny

PS: I know that Hristo already explained about adding to the contact
list, but sometimes you just have to see in order to know the exact
behavior and impact. :slight_smile:

On 01/07/2014 10:59 AM, Hristo Terezov wrote:

Hi Danny,

In the jabber implementation when we are creating volatile contact we call ServerStoredContactListJabberImpl.fireContactAdded method which fires subscription create event. MetaContactListServiceImpl.ContactListSubscriptionListener.subscriptionCreated method receives that event and creates the meta contact. That’s how the meta contact is created in the jabber implementation.

If you don’t want to follow the jabber implementation completely I think you can put all needed implementation in your ChatRoom class. You must create a SourceContact instance if it is not created yet and then create meta contact for it . For creating the meta contact you can refer to ServerStoredContactListJabberImpl.createVolatileContact and fire the same events. You should also add Source Contact to the not in contact list group and create it if it doesn’t exists. Maybe you will need a class for the group.

I hope this helps. If you need more help or if you have any questions don’t hesitate to ask me.

Regards,
Hristo.

On Dec 29, 2013, at 1:28 AM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

Hi,

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and message was: null
java.lang.NullPointerException
  at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
  at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
  at
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
  at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
  at java.awt.Component.processMouseEvent(Component.java:6508)
  at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
  at
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
  at java.awt.Component.processEvent(Component.java:6270)
  at java.awt.Container.processEvent(Container.java:2229)
  at java.awt.Component.dispatchEventImpl(Component.java:4861)
  at java.awt.Container.dispatchEventImpl(Container.java:2287)
  at java.awt.Component.dispatchEvent(Component.java:4687)
  at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
  at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
  at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
  at java.awt.Container.dispatchEventImpl(Container.java:2273)
  at java.awt.Window.dispatchEventImpl(Window.java:2719)
  at java.awt.Component.dispatchEvent(Component.java:4687)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
  at java.awt.EventQueue.access$200(EventQueue.java:103)
  at java.awt.EventQueue$3.run(EventQueue.java:688)
  at java.awt.EventQueue$3.run(EventQueue.java:686)
  at java.security.AccessController.doPrivileged(Native Method)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
  at java.awt.EventQueue$4.run(EventQueue.java:702)
  at java.awt.EventQueue$4.run(EventQueue.java:700)
  at java.security.AccessController.doPrivileged(Native Method)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
  at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
  at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
  at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev


#7

Hi Hristo,

Hi Danny,

Hi Devs, Hristo,

Okay ... so I have been fiddling around a bit with
OpSetPersistentPresence and I got something *very* preliminary working.
Enough to discover that I do need OpSetBasicInstantMessaging, which
isn't that much of a surprise, actually, just good to have confirmation.
But I also discovered something else �

Are you planning to use the OpSetBasicInstantMessaging for the private messaging?
In general it is not required to have OpSetBasicInstantMessaging if you have OpSetPersistentPresence (I don�t think that OpSetPersistentPresence service uses explicitly OpSetBasicInstantMessaging ).

That's good news. Will look at that soon.

Every contact that isn't already in the list is supposed to be added as
a contact in the group "Not In Contact List" (or something like that).
... I don't think you'll like that behavior with IRC channels. I joined
2 pretty crowded channels and there were over 4000 contacts in this
group ... (and then Jitsi froze which is probably due to the incomplete
implementation).

Do you mean you are adding in the contact list all the members in the IRC channel that was joined? In the jabber implementation we add member of the chat room in the �Not In Contact List� group only if the private messaging conversation has been started.

Ah right! I am still trying to get to grips with the control flow inside
Jitsi around contacts. Double-clicking a chat room member would
Initially just cause an NPE, so it wasn't immediately clear to me how to
influence that. That's why I added all chat room members as contacts. I
will have another look at this. Now that I think about it, I think I
should have a look in the area of the MUC interface, I believe there's
something that finds the private contact corresponding to the chat room
member, or something.

Thanks for the pointers!

Danny

···

On 04/14/2014 09:47 AM, Hristo Terezov wrote:

On Apr 13, 2014, at 4:08 PM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

I don't think that this is the right approach for IRC chat room members
... I am going to have a look at how I might do without the contact
list, but that could be tricky.

Regards,
Danny

PS: I know that Hristo already explained about adding to the contact
list, but sometimes you just have to see in order to know the exact
behavior and impact. :slight_smile:

On 01/07/2014 10:59 AM, Hristo Terezov wrote:

Hi Danny,

In the jabber implementation when we are creating volatile contact we call ServerStoredContactListJabberImpl.fireContactAdded method which fires subscription create event. MetaContactListServiceImpl.ContactListSubscriptionListener.subscriptionCreated method receives that event and creates the meta contact. That�s how the meta contact is created in the jabber implementation.

If you don�t want to follow the jabber implementation completely I think you can put all needed implementation in your ChatRoom class. You must create a SourceContact instance if it is not created yet and then create meta contact for it . For creating the meta contact you can refer to ServerStoredContactListJabberImpl.createVolatileContact and fire the same events. You should also add Source Contact to the not in contact list group and create it if it doesn�t exists. Maybe you will need a class for the group.

I hope this helps. If you need more help or if you have any questions don�t hesitate to ask me.

Regards,
Hristo.

On Dec 29, 2013, at 1:28 AM, Danny van Heumen <danny@dannyvanheumen.nl> wrote:

Hi,

I'm currently looking into supporting private messages. My first
attempts are to send a private message by double clicking on a chat room
contact, hoping that a "private messaging"-window will open. The first
exception I got had to do with some unimplemented parts of the
interface. I now have a *very* limited "ContactIrcImpl" class in order
to provide the required implementation, however I quickly get stuck on
the next step, which is to acquire a corresponding MetaContact instance.

I have been looking at this infrastructure, but I don't quite get how
this is meant to work.

The Jabber implementation accesses an OperationSetPersistentPresence
instance in order to acquire a volatile contact which is either created
or retrieved from a notInContactListGroup.

I would appreciate any hints on how to approach the implementation. I
could "recreate" Jabber's implementation however it seems like that
there is support for many more features there that are not required. On
the other hand, I am not quite sure if it's okay to do a "smallest
possible implementation" which may come back to haunt me in the future.

This stack trace is my attempt at "private messaging" with the currently
skeleton implementation. I am aware that you do not have all the code,
however the problems originates from Jitsi itself. In the method
'openPrivateChatForChatRoomMember' a metacontact is retrieved, which
currently just returns null.

Thanks!

00:02:31.756 SEVERE: [43] util.UtilActivator.uncaughtException().108 An
uncaught exception occurred in thread=Thread[AWT-EventQueue-0,6,main]
and message was: null
java.lang.NullPointerException
  at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.initChatTransports(MetaContactChatSession.java:321)
  at
net.java.sip.communicator.impl.gui.main.chat.MetaContactChatSession.<init>(MetaContactChatSession.java:71)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.createChat(ChatWindowManager.java:1106)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:537)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.access$700(ChatWindowManager.java:38)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$MetaContactChatCreateRunnable.createChatPanel(ChatWindowManager.java:1573)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.run(ChatWindowManager.java:1510)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager$AbstractChatPanelCreateRunnable.getChatPanel(ChatWindowManager.java:1499)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:500)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.getContactChat(ChatWindowManager.java:475)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:144)
  at
net.java.sip.communicator.impl.gui.main.chat.ChatWindowManager.openPrivateChatForChatRoomMember(ChatWindowManager.java:114)
  at
net.java.sip.communicator.impl.gui.main.chat.conference.ChatRoomMemberListPanel$1.mouseClicked(ChatRoomMemberListPanel.java:117)
  at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
  at java.awt.Component.processMouseEvent(Component.java:6508)
  at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
  at
net.java.sip.communicator.impl.gui.main.contactlist.DefaultContactList.processMouseEvent(DefaultContactList.java:360)
  at java.awt.Component.processEvent(Component.java:6270)
  at java.awt.Container.processEvent(Container.java:2229)
  at java.awt.Component.dispatchEventImpl(Component.java:4861)
  at java.awt.Container.dispatchEventImpl(Container.java:2287)
  at java.awt.Component.dispatchEvent(Component.java:4687)
  at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
  at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
  at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
  at java.awt.Container.dispatchEventImpl(Container.java:2273)
  at java.awt.Window.dispatchEventImpl(Window.java:2719)
  at java.awt.Component.dispatchEvent(Component.java:4687)
  at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
  at java.awt.EventQueue.access$200(EventQueue.java:103)
  at java.awt.EventQueue$3.run(EventQueue.java:688)
  at java.awt.EventQueue$3.run(EventQueue.java:686)
  at java.security.AccessController.doPrivileged(Native Method)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
  at java.awt.EventQueue$4.run(EventQueue.java:702)
  at java.awt.EventQueue$4.run(EventQueue.java:700)
  at java.security.AccessController.doPrivileged(Native Method)
  at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
  at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
  at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
  at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
  at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
  at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@jitsi.org
Unsubscribe instructions and other list options:
http://lists.jitsi.org/mailman/listinfo/dev