1 Replies Last post: Jun 30, 2008 4:17 PM by Gijs de Vries  
joel Bronze 1 posts since
Jun 2, 2008
Currently Being Moderated

Jun 2, 2008 10:23 PM

tiny chatmanager bug

 

in Smack 3.0.4, I think the ChatManager is being inconsistent about the key used in the jidChats map.  The "get" uses the "bare" address, but the "put" uses the entire address.  I think you want this change.  what do you think?

 

 

 

 

diff old/ChatManager.java new/ChatManager.java

163c163

<         jidChats.put(userJID, chat);

---

>         jidChats.put(StringUtils.parseBareAddress(userJID), chat);

 

 

 

 

Gijs de Vries Bronze 1 posts since
Jun 30, 2008
Currently Being Moderated
Jun 30, 2008 4:17 PM in response to: joel
Re: tiny chatmanager bug

I've got the same problem. This causes the chatmanager to spawn new chats for every incoming message. 

 

 

I am  using the following listener to get around this problem:

 


     //Workaround for bug in smack
     connection.addPacketListener(new PacketListener(){
             & nbsp; public void processPacket(Packet p) {
             & nbsp;      p.setFrom(StringUtils.parseBareAddress( p.getFrom()));
             & nbsp; }
          },null);

 

It changes the from address into the bare address. This way I do not have to poke around in the smack code to fix this problem.

 

I do however hope this bug will end up in the issue tracker.

More Like This

  • Retrieving data ...