Hello.
1)On asmack-android-17-0.8.3 the Issue is that Chatmanager listening does not work properly and its callbacks is not handled. My code on asmack-2010 library worked well before.And i want to use last library cause it reconnection works quite well
On current asmack lib i am obliged to create chat using this piece of code below. But it still does not work properly cause i have to remove,immediately, the messagelistener for that user after getting his unavailability . Or Otherwise i will be getting my own messages back while his unavailability . as if it was send from that user.
current_chat = chatmanager.createChat(userid, userid, mmlistener); //and here is my listener private MessageListener mmlistener = new MessageListener() { @Override publicvoid processMessage(Chat chat, Message message) { if (callbacks != null&& message.getBody() != null) callbacks .received_message(message.getFrom(), message.getBody()); } };publicvoid sendMessageOnCurrent(String message) throws XMPPException { try{ Message m = new Message(); m.setBody(message); if (current_chat != null) { current_chat.sendMessage(m); } }catch (Exception ex) { }}
Issue is that Chatmanager listening does not work properly and its callbacks is not handled. My code on asmack-2010 library worked well before.
On current asmack lib i am obliged to create chat using this piece of code below. But it still does not work properly cause i have to remove,immediately, the messagelistener for that user after getting his unavailability . Or Otherwise i will be getting my own messages back while his unavailability . as if it was send from that user.
current_chat = chatmanager.createChat(userid, userid, mmlistener); //and here is my listener private MessageListener mmlistener = new MessageListener() { @Override public void processMessage(Chat chat, Message message) { if (callbacks != null && message.getBody() != null) callbacks .received_message(message.getFrom(), message.getBody()); } }; public void sendMessageOnCurrent(String message) throws XMPPException { try { Message m = new Message(); m.setBody(message); if (current_chat != null) { current_chat.sendMessage(m); } } catch (Exception ex) { } }
2)And one more i wanted to ask while another users get offline cause wifi or internet drop my user presence still shows online for several minutes .how i can set it to minimum. im using android