Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
AliVireTechnologies1 #1
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
Subject: invite members to group at the time of group creation issue
  I am using these  following lines for adding a group and inviting members at the time of creation but it is giving an error, "PropertyNotSetException"

  1. MucManager mucManager = new MucManager(Utility.xmppClient);
  2. string roomId = txtgroupname.Text + "@conference." + Utility.Domain; //id is dynamic
  3. Jid m_RoomJid = new Jid(roomId);
  4.  
  5. mucManager.CreateEnterRoomStanza(roomId, "ali");
  6. mucManager.EnterRoom(m_RoomJid,Utility.xmppClient.Username, true);
  7. foreach (KeyValuePair<string, string> cg in Utility.contactgroup) //cg.key =PhoneNumber cg.value=Name of User
  8. {
  9.          Utility.mucManager.Invite(cg.Key + "@" + Utility.Domain, m_RoomJid , "want to chat");    //This line giving an error                          
  10. }

//         stack trace of Exception

 {Matrix.PropertyNotSetException: XmppClient
   at Matrix.Xmpp.Client.MucManager.#=q8PMBmJcZohgYyPHo$pbK5A==(XmppXElement #=qbW97V$uc7h2LAu51z2UTtg==)
   at Matrix.Xmpp.Client.MucManager.Invite(Jid[] jids, Jid room, String reason, String thread)
   at Matrix.Xmpp.Client.MucManager.Invite(Jid[] jids, Jid room, String reason)
   at Matrix.Xmpp.Client.MucManager.Invite(Jid to, Jid room, String reason)
   at VtalkkMessenger.AddGroup.ApplicationBarIconButton_Click_2(Object sender, EventArgs e)}
This post was edited on 2013-07-22, 09:19 by AliVireTechnologies1.
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
The PropertyNotSetException raises when your XmppClient is null.
You can only execute functions in teh MucManager when you are connected to the XmppServer and you pass the correct XmppClient instance which is not null.

You can remove this line in your code because it does nothing:
  1. mucManager.CreateEnterRoomStanza(roomId, "ali");

Please download also Desktop version of MatriX. In the MiniClient example of the desktop version you can see how to use the MucManager.
Avatar
AliVireTechnologies1 #3
Member since Jun 2013 · 58 posts
Group memberships: Members
Show profile · Link to this post
room is creating, and unlocking from on_presence event but on the receiving end em not receiving any group invitation

//=================create and invite function=================

 string roomId = "mygroup@conference.vtalk.viretechnologies.com";
                        Jid m_RoomJid = new Jid(roomId);
                        Utility.mucManager.EnterRoom(m_RoomJid, Utility.xmppClient.Username, true);
                        Utility.mucManager.Invite("92323@vtalk.viretechnologies.com", m_RoomJid , "want to chat");

                        }

//================Unlock group=================

   void xmppClient_OnPresence(object sender, PresenceEventArgs e)     // Getting online status and getting friendinvitation messsage.
        {

            var pres = e.Presence;

            if (pres.From.Equals(new Jid(e.Presence.From.User + "@conference." + Utility.Domain + "/" + e.Presence.To.User), fjc))
            {
                //self presence
                var xUser = pres.MucUser;
                if (xUser != null)
                {
                    if (xUser.HasStatus(110))
                    {

                    }

                    if (xUser.HasStatus(201))
                    {
                        // 201, Inform user that a new room has been created
                        Utility.mucManager.RequestInstantRoom(e.Presence.From, InstantRoomResult);
                    }
                }
            }
}
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters: