Giter VIP home page Giter VIP logo

Comments (10)

woj-tek avatar woj-tek commented on July 29, 2024

There is an option auto-authorize that allows you to automatically authorise requests, see https://docs.tigase.net/tigase-server/master-snapshot/Administration_Guide/html/#autoSub (if this link doesn't work yet use this one and scroll a bit down.

However, if you manage roster externally then using Dynamic Rosters seems like a better idea.

from tigase-server.

dcokan avatar dcokan commented on July 29, 2024

Hmm I updated the configuration accordingly, but still I am getting a rooster with type="subscribe" in the Tigase UI client I am receiving the popup with question to accept the contact invitation.

from tigase-server.

woj-tek avatar woj-tek commented on July 29, 2024

This is because... there was an error in the documentation :-)

A while back we decided to split presence plugin into two for efficiency: one responsible for handling subscriptions (presence-subscription) and state (sharing presence information depending on the state: presence-state). Old presence plugin is still there but it's not enabled by default and if you used configuration from the documentation then 'auto-authorize' = 'true' would not be enabled for correct, active plugin. You should use:

'sess-man' () {
    'jabber:iq:roster' {
        'auto-authorize' = 'true'
    }
    'presence-subscription' () {
        'auto-authorize' = 'true'
    }
}

I just check it and it works as expected:

U1 sends:

<presence type='subscribe' to='tigase2@atlantiscity'/>

U1 recives:

<iq type="set" to="tigase1@atlantiscity/Psi+/2" id="rsttig5">
    <query xmlns="jabber:iq:roster" ver="15a2ec55b9eed0485d6da92f487d547a">
        <item subscription="both" name="tigase2" jid="tigase2@atlantiscity"/>
    </query>
</iq>

<presence from="tigase2@atlantiscity/Psi+" to="tigase1@atlantiscity">
    <priority>55</priority>
    <c xmlns="http://jabber.org/protocol/caps" node="http://psi-dev.googlecode.com/caps" ver="0.16" ext="cs e-time ep-notify-2 last-act mr sxe whiteboard"/>
</presence>

U2 recives:

<iq type="set" to="tigase2@atlantiscity/Psi+" id="rsttig4">
    <query xmlns="jabber:iq:roster" ver="2c801cc687581d9263dea90e5b873cfd">
        <item subscription="both" name="tigase1" jid="tigase1@atlantiscity"/>
    </query>
</iq>


<presence from="tigase1@atlantiscity/Psi+/2" to="tigase2@atlantiscity">
    <priority>64</priority>
    <c xmlns="http://jabber.org/protocol/caps" node="http://psi-dev.googlecode.com/caps" ver="0.16" ext="cs e-time ep-notify-2 last-act mr sxe whiteboard"/>
</presence>

from tigase-server.

dcokan avatar dcokan commented on July 29, 2024

Hah :) thanks it worked. Should I raise a request to update documentation or that defect is enough ?

from tigase-server.

woj-tek avatar woj-tek commented on July 29, 2024

It was already fixed yesterday af8116e :-)

from tigase-server.

dcokan avatar dcokan commented on July 29, 2024

Hi again :)

It works fine when I am sending a stanza like you shown. However We decided to move the connecting the users to Server to be invoked at given scenarios.

In our BE we are trying to send the HTTP request with proper stanza:
So I am sending a request to:
POST /rest/stream/?api-key=our-api-key
with body:

<presence type="subscribe" xmlns="jabber:client" from="[email protected]" to="[email protected]" />

I am receiving 200, and the following happens:

toUser receives rooster with subscription like in your above message, but just after that he receives also rooster but subscription is set to from instead both:

<iq type="set" to="[email protected]" id="rsttig4">
    <query xmlns="jabber:iq:roster">
        <item subscription="from" name="fromUser" jid="[email protected]"/>
    </query>
</iq>

About the fromUser he receives subscription="none"...

It looks like a stanza I sent through REST is interpreted differently the one I send in the UI client. Should I know anything more about the REST call?

from tigase-server.

hantu85 avatar hantu85 commented on July 29, 2024

REST requests are not processed by fromUser but are injected on the server-side as if they were received, ie. from the remote server, so fromUser's roster is not aware of <presence/> stanza sent by you using REST request and that stanza was delivered only to toUser.

Due to thatfromUser in roster has subscription set to none and toUser has in roster subsription set to from.

from tigase-server.

dcokan avatar dcokan commented on July 29, 2024

Hmm so how can I manage it? Can I send second stanza setting to="fromUser" ? Do you have any hints?

from tigase-server.

hantu85 avatar hantu85 commented on July 29, 2024

Well, I think that sending presence stanzas to both users (so that both users would be aware of that) could be possible, but it is possible that it may not be possible if some presence sent from the account owner to the server would be required.

However, if both users accounts are on your own server you could check user-roster-management and user-roster-management-ext ad-hoc commands as they were designed for manipulation of users roster by the server on the user's behalf.

from tigase-server.

dcokan avatar dcokan commented on July 29, 2024

I checked these commands and although the response returns information that operation was successful there is no change in roster list... Fortunately if I run roster-fixer command it seems to work. I will confirm that

from tigase-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.