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

is this possible to create one group and add members without members consent in swift #1217

Open
arunpandiyanp opened this issue Mar 25, 2022 · 7 comments

Comments

@arunpandiyanp
Copy link

arunpandiyanp commented Mar 25, 2022

if i create one group and add members using inviteUser and add editPrivileges as a Member.

My question is I create one group and add members without member consent? @vitalyster

@vitalyster
Copy link
Contributor

You can edit privileges without an invite

@arunpandiyanp
Copy link
Author

i tried it does not work for me.

what I need is if someone invites me to a group means I will add that group automatically ?

i tried that code :

func xmppStream(_ sender: XMPPStream, didReceive presence: XMPPPresence) {
      
         xmppRoster.acceptPresenceSubscriptionRequest(from: (presence.from)!, andAddToRoster: true)
    }

but the issue is it added in the roaster list, not in the group list

@vitalyster
Copy link
Contributor

vitalyster commented Mar 28, 2022

Invites, presences and privileges are totally different things, you can modify room privileges and add any JID to members list without any user consent.
You can try to play with it using existing desktop client (Psi, for example) and its XML console - it will give you better understandings.

@arunpandiyanp
Copy link
Author

in didFetchConfigurationForm, I will give only this thing. can I give any additional config for join users without any user consent like WhatsApp @vitalyster ?

public func xmppRoom(_ sender: XMPPRoom, didFetchConfigurationForm configForm: DDXMLElement) {
     print("didFetchConfigurationForm")

             let newForm = configForm.copy() as! DDXMLElement

             for field in newForm.elements(forName: "field") {
                
                 if let _var = field.attributeStringValue(forName: "var") {

                     switch _var {
                     case "muc#roomconfig_persistentroom":
                         field.remove(forName: "value")
                         field.addChild(DDXMLElement(name: "value", numberValue: 1))
                         

                  

                     // other configures
                     default:
                         break
                     }

                 }

             }

             sender.configureRoom(usingOptions: newForm)
   

     
 }

@vitalyster
Copy link
Contributor

How room configuration is related here? You can not force other users to join the room

@arunpandiyanp
Copy link
Author

oh okay. is this not possible to add a user first-time auto-join right? once they accept that invitation or press the join button is the only way for the first time to join right?

@arunpandiyanp
Copy link
Author

I'm new in XMPP framework in swift , can you please guide @vitalyster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants