Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presence Status not changing after accepting friend request (first conversation) #409

Closed
citerio opened this issue Nov 23, 2016 · 9 comments
Labels
Milestone

Comments

@citerio
Copy link

citerio commented Nov 23, 2016

Hi there, Presence Status is not changing after the friend request is accepted and both users start chatting for the first time. It only changes after logging out and logging in again. When user A changes his/her presence status (e.g: from Online to Away) the user B receives the messages (Presence (A@localhost): 3) but the user A icon and status are still Online (on B friends/buddies list). This only happens in the first conversation after the friend request. You can check out the images below;

Status:
Online=5
Chatty=4
Away=3
Extended Away =2
Do not Disturb=1
Offline=0

User A = Citerio
userciterio

User B = Nick
usernick

You can see Presence status in the console and the Buddy Status Icon

Citerio should appear as "Do not Disturb" and NIck as "Extended Away", but Both Citerio and Nick appear "Online" to each other.

@citerio
Copy link
Author

citerio commented Nov 24, 2016

I'm using v3.0.1

@sualko
Copy link
Member

sualko commented Nov 24, 2016

Can you post the call trace from "fnName.split is not a function" (just click on the little triangle).

This only happens in the first conversation after the friend request.

So afterwards everything wents smooth?

@citerio
Copy link
Author

citerio commented Nov 24, 2016

Hey Klaus, thanks for replying. Ok, I changed some behaviors of the library, so the friend request is auto accepted at both sides, and this error: "TypeError fnName.split is not a function" is due to I commented a function, but it has nothing to do with the issue exposed above. This happened the very first time I started using the library (5 days ago) before doing changes to the code. Finally, yes, this presence status bug only happens after the friend request, If both users log out and log in again then changing presence status works fine. So, don't worry about the TypeError my friend. Yesterday, I spent hours trying to debug onPresence function, and I could noticed that the issue probably is in this part:

`delse` {
        `var` show = $(presence).find('show').text();
         `if` (show === '') {
            status = jsxc.CONST.STATUS.indexOf('online');			
         } `else` {
            status = jsxc.CONST.STATUS.indexOf(show);			
         }
  
      }

I'm pretty sure about it because the online status got stuck on both sides, The first status I received from the other user is 0 (offline), followed by 5 (online) and finally the current and true user status, as you can see in one of the images (console, status 0, 5 and 3) but the status icon doesn't change, it just keeps online status. I tried passing the user status in the along with the friend request, so instead of setting the status to online if show is empty, I just set the status to buddy_status (variable that contains current status of my buddy). It works halfway, because the buddy appears on my list with the current status, e.g: 3 (Away) but after that, when I try to change the status again on any side it does't totally works, some statuses change but another ones don't. I did receive each presence status change message in my console (like shown in the images) but I think it's a issue related to the status refresh on the buddy list.

@sualko sualko added the bug label Nov 28, 2016
@citerio
Copy link
Author

citerio commented Nov 29, 2016

I think I fixed this bug Klaus, presence statuses are changing after the handshake, it's working good so far.

@sualko
Copy link
Member

sualko commented Nov 29, 2016

Can you provide a patch? That would be awesome.

@citerio
Copy link
Author

citerio commented Dec 2, 2016

Hey Klaus, Sure, I'll provide a patch.

@sualko
Copy link
Member

sualko commented Dec 13, 2016

Any update?

@citerio
Copy link
Author

citerio commented Jan 13, 2017

Hey Klaus, I'll be posting the fix that worked for me.

@sualko sualko added this to the 3.1 milestone Jan 13, 2017
@sualko
Copy link
Member

sualko commented Jan 19, 2017

@citerio If you like you can post it right here.

@sualko sualko closed this as completed in ac55184 Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants