Esempio n. 1
0
		/// <summary>
		/// Gets the attention of the XMPP user with the specified JID.
		/// </summary>
		/// <param name="jid">The JID of the user to grab the attention of.</param>
		/// <param name="message">A message to sent along.</param>
		/// <exception cref="ArgumentNullException">The jid parameter
		/// is null.</exception>
		/// <exception cref="NotSupportedException">The XMPP entity with
		/// the specified JID does not support the 'Attention' XMPP
		/// extension.</exception>
		public void GetAttention(Jid jid, string message = null) {
			jid.ThrowIfNull("jid");
			if(!ecapa.Supports(jid, Extension.Attention)) {
				throw new NotSupportedException("The XMPP entity does not support the " +
					"'Attention' extension.");
			}
			Im.Message m = new Im.Message(jid, message);
			// Add the 'attention' element to the message.
			m.Data.Child(Xml.Element("attention", "urn:xmpp:attention:0"));
			im.SendMessage(m);
		}
Esempio n. 2
0
 /// <summary>
 /// Gets the attention of the XMPP user with the specified JID.
 /// </summary>
 /// <param name="jid">The JID of the user to grab the attention of.</param>
 /// <param name="message">A message to sent along.</param>
 /// <exception cref="ArgumentNullException">The jid parameter
 /// is null.</exception>
 /// <exception cref="NotSupportedException">The XMPP entity with
 /// the specified JID does not support the 'Attention' XMPP
 /// extension.</exception>
 public void GetAttention(Jid jid, string message = null)
 {
     jid.ThrowIfNull("jid");
     if (!ecapa.Supports(jid, Extension.Attention))
     {
         throw new NotSupportedException("The XMPP entity does not support the " +
                                         "'Attention' extension.");
     }
     Im.Message m = new Im.Message(jid, message);
     // Add the 'attention' element to the message.
     m.Data.Child(Xml.Element("attention", "urn:xmpp:attention:0"));
     im.SendMessage(m);
 }