Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
sameh_zaky #1
Member since May 2008 · 8 posts · Location: Egypt
Group memberships: Members
Show profile · Link to this post
Subject: Disable chat room history again
hi every one,
in the "frmGroupChat" form in the "MiniClient" example
in the "formLoad" this code is excute
{
                Presence pres = new Presence();
                Jid to = new Jid(m_RoomJid.ToString());
                to.Resource = m_Nickname;
                pres.To = to;
                m_XmppCon.Send(pres);
                pres.RemoveTag("x");
}
the value of "pres" is "<presence xmlns="jabber:client" to="test@conference.jb.birdict.com/sa" />"
I want to stop getting the client history,so as i have read in the forum i have to put "<history maxchars='0'/>"
where can i put this tag?
thanks
Avatar
sameh_zaky #2
Member since May 2008 · 8 posts · Location: Egypt
Group memberships: Members
Show profile · Link to this post
hi every body,

i use Openfire 3.5.1 in History Settings
i disable the chat room history
but i stile get the chat history until now.
are there any option more i have to Configure it,
or some thing like reset the log of the server,...

thanks
Avatar
Alex #3
Member since Feb 2003 · 4288 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
look at the MucManager is has a function for this:

  1. /// <summary>
  2. /// Join a chatroom
  3. /// </summary>
  4. /// <param name="room">jid of the room to join</param>
  5. /// <param name="nickname">nickname to use in the room</param>
  6. /// <param name="disableHistory">true for joining without chat room history</param>
  7. public void JoinRoom(Jid room, string nickname, bool disableHistory)
  8. {
  9.     JoinRoom(room, nickname, null, disableHistory);
  10. }

you can also look at the code which the function is calling

  1. /// <summary>
  2. /// Join a chatroom
  3. /// </summary>
  4. /// <param name="room">jid of the room to join</param>
  5. /// <param name="nickname">nickname to use in the room</param>
  6. /// <param name="password">password for password protected chat rooms</param>
  7. /// <param name="disableHistory">true for joining without chat room history</param>
  8. public void JoinRoom(Jid room, string nickname, string password, bool disableHistory)
  9. {       
  10.     Jid to = new Jid(room.ToString());
  11.     to.Resource = nickname;           
  12.  
  13.     Presence pres = new Presence();
  14.     pres.To = to;
  15.     Muc x = new Muc();
  16.     if (password != null)
  17.         x.Password = password;
  18.  
  19.     if (disableHistory)
  20.     {
  21.         History hist = new History();
  22.         hist.MaxCharacters = 0;
  23.         x.History = hist;
  24.     }
  25.    
  26.     pres.AddChild(x);
  27.  
  28.     m_connection.Send(pres);
  29. }

Alex
Avatar
sameh_zaky #4
Member since May 2008 · 8 posts · Location: Egypt
Group memberships: Members
Show profile · Link to this post
many thanks alex
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:
Forum: agsXMPP RSS