processone / ejabberd-contrib

Growing and curated ejabberd contributions repository - PR or ask to join !
http://ejabberd.im
250 stars 140 forks source link

Roster subscription not working #233

Closed ankitdoshi closed 6 years ago

ankitdoshi commented 6 years ago

I am using ejabberd 17.09 version.For roster management using rest api .I have added roster using add_rosteritem command

root@db01:~# ejabberdctl get_roster 915454 localhost
919595@localhost    919595  both    none    
root@db01:~# ejabberdctl get_roster 919595 localhost
919033745739@localhost      to  none    
91998877@localhost  91998877    both    none

As per above code we can clearly see that 915454 user have 919595 roster with subscription both but when checking roster of 919595 there is no any entry of user 915454.

Will you please check and confirm and provide some more information about this issue ?

badlop commented 6 years ago

add_rosteritem does exactly what its name says, and nothing more. So, it adds an item to a user's roster. It does not add any other complementary roster item to any other user. That is your task: run add_rosteritem for the other user.

ankitdoshi commented 6 years ago

Then will you please explain more details about subs argument which is required to execute add_rosteritem ?

On Dec 20, 2017 4:48 PM, "badlop" notifications@github.com wrote:

add_rosteritem does exactly what its name says, and nothing more. So, it adds an item to a user's roster. It does not add any other complementary roster item to any other user. That is your task: run add_rosteritem for the other user.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/processone/ejabberd-contrib/issues/233#issuecomment-353036751, or mute the thread https://github.com/notifications/unsubscribe-auth/AD-Yrc-_YqCm1FNNXBHufwZEkpqddTK3ks5tCOz0gaJpZM4RH86c .

badlop commented 6 years ago

It is your duty, as administrator, to provide the correct Subs value.

In this example, I add user2 to user1's roster, and later I add user1 to user2's roster. In this case, I set subs=both in the two calls:

$ ejabberdctl add_rosteritem user1 localhost user2 localhost User2 Friends both
$ ejabberdctl add_rosteritem user2 localhost user1 localhost User1 Friends both
$ 

I think you are doing the first call. Now reember to also make the second call.

ankitdoshi commented 6 years ago

Yeah i understand whatever you are saying.But my question is what is use of sub and what will be effect of it in different different values ?

Like if i set subs=none or subs= both then what is difference between both of it

@cromain :Without detail information please don't close this issue.

I have already asked detail information of subs arguement.Which is not available in documentation as per my knowledge.If its available in documentation then please share link of it here like difference between subs value and it's effect on rosteritem.

badlop commented 6 years ago

what is use of sub and what will be effect of it in different different values ?

The "subscription" is a XMPP concept, explained in https://tools.ietf.org/html/rfc6121#section-2.1.2.5