Logo Search packages:      
Sourcecode: jabber-jit version File versions  Download package

events.cpp

/*
 * Events
 *
 * Copyright (C) 2001 Barnaby Gray <barnaby@beedesign.co.uk>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 */

#include <libicq2000/events.h>

#include <libicq2000/Contact.h>

using std::string;

namespace ICQ2000 {

  // ============================================================================
  //  Event base class
  // ============================================================================

  /**
   *  Base constructor for events, timestamp set to now.
   */
00037   Event::Event() {
    m_time = time(NULL);
  }

  /**
   *  Base constructor for events, with a set timestamp.
   */
00044   Event::Event(time_t t) : m_time(t) { }
  
  /**
   *  get the time when the event occurred.
   *
   * @return the time
   */
00051   time_t Event::getTime() const { return m_time; }

  /**
   *  set the time of the event. This is used by the library only, and
   *  is of no interest to the client.
   *
   * @param t the time
   */
00059   void Event::setTime(time_t t) { m_time = t; }


  // ============================================================================
  //  Connecting Event
  // ============================================================================

  /**
   *  Simple constructor for a ConnectingEvent.
   */
00069   ConnectingEvent::ConnectingEvent() { }

  // ============================================================================
  //  Connected Event
  // ============================================================================

  /**
   *  Simple constructor for a ConnectedEvent.
   */
00078   ConnectedEvent::ConnectedEvent() { }

  // ============================================================================
  //  Disconnected Event
  // ============================================================================

  /**
   *  Constructor for a DisconnectedEvent.
   */
00087   DisconnectedEvent::DisconnectedEvent(Reason r) : m_reason(r) { }

  /**
   *  get the reason for disconnection.
   *
   * @return reason for disconnection
   */
00094   DisconnectedEvent::Reason DisconnectedEvent::getReason() const { return m_reason; }
  
  // ============================================================================
  //  Log Event
  // ============================================================================

  /**
   *  Constructor for a LogEvent.
   *
   * @param type type of log messages
   * @param msg the log message
   */
  LogEvent::LogEvent(LogType type, const string& msg)
    : m_type(type), m_msg(msg) { }

  /**
   *  get the type of the log message
   *
   * @return type of the log message
   */
00114   LogEvent::LogType LogEvent::getType() const { return m_type; }

  /**
   *  get the log message
   *
   * @return log message
   */
00121   string LogEvent::getMessage() const { return m_msg; }

  // ============================================================================
  //  Contact List Event
  // ============================================================================

  /**
   *  Base constructor for contact list events.
   *
   * @param c the contact
   */
00132   ContactListEvent::ContactListEvent(ContactRef c) { m_contact = c; }

  /**
   *  get the contact
   *
   * @return the contact
   */
00139   ContactRef ContactListEvent::getContact() const { return m_contact; }

  /**
   *  get the uin of the contact. This could be done just as easily,
   *  with getContact()->getUIN(), provided for convenience.
   *
   * @return
   */
00147   unsigned int ContactListEvent::getUIN() const { return m_contact->getUIN(); }
    
  /**
   *  Destructor for ContactListEvent
   */
00152   ContactListEvent::~ContactListEvent() { }

  // ============================================================================
  //  UserAdded Event
  // ============================================================================

  /**
   *  Constructor for UserAddedEvent
   *
   * @param contact the contact that has just been added
   */
00163   UserAddedEvent::UserAddedEvent(ContactRef contact) : ContactListEvent(contact) { }
00164   ContactListEvent::EventType UserAddedEvent::getType() const { return UserAdded; }

  // ============================================================================
  //  UserRemoved Event
  // ============================================================================

  /**
   *  Constructor for UserRemovedEvent
   *
   * @param contact the contact that is about to be removed
   */
00175   UserRemovedEvent::UserRemovedEvent(ContactRef contact) : ContactListEvent(contact) { }
00176   ContactListEvent::EventType UserRemovedEvent::getType() const { return UserRemoved; }

  // ============================================================================
  //  ServerBasedContactEvent
  // ============================================================================

  ServerBasedContactEvent::ServerBasedContactEvent(const ContactList& l) : m_clist(l) { }
  ContactList& ServerBasedContactEvent::getContactList() { return m_clist; }

  // ============================================================================
  //  Contact Event
  // ============================================================================

  /**
   *  Base constructor for contact list events.
   *
   * @param c the contact
   */
00194   ContactEvent::ContactEvent(ContactRef c) { m_contact = c; }

  /**
   *  get the contact
   *
   * @return the contact
   */
00201   ContactRef ContactEvent::getContact() const { return m_contact; }

  /**
   *  get the uin of the contact. This could be done just as easily,
   *  with getContact()->getUIN(), provided for convenience.
   *
   * @return
   */
00209   unsigned int ContactEvent::getUIN() const { return m_contact->getUIN(); }
    
  /**
   *  Destructor for ContactEvent
   */
00214   ContactEvent::~ContactEvent() { }

  // ============================================================================
  //  Status Change Event
  // ============================================================================

  /**
   *  Constructor for StatusChangeEvent
   *
   * @param contact the contact whose status has changed
   * @param st the new status
   * @param old_st the old status
   */
00227   StatusChangeEvent::StatusChangeEvent(ContactRef contact, Status st, Status old_st)
    : ContactEvent(contact), m_status(st), m_old_status(old_st) { }
  
00230   ContactEvent::EventType StatusChangeEvent::getType() const { return StatusChange; }

  /**
   *  get the new status of the contact
   *
   * @return the new status
   */
00237   Status StatusChangeEvent::getStatus() const { return m_status; }

  /**
   *  get the old status of the contact
   *
   * @return the old status
   */
00244   Status StatusChangeEvent::getOldStatus() const { return m_old_status; }

  // ============================================================================
  //  User Info Change Event
  // ============================================================================

  /**
   *  Constructor for UserInfoChangeEvent
   *
   * @param contact the contact whose information has changed
   */
00255   UserInfoChangeEvent::UserInfoChangeEvent(ContactRef contact, bool is_transient_detail) : ContactEvent(contact), m_is_transient_detail(is_transient_detail) { }
00256   ContactEvent::EventType UserInfoChangeEvent::getType() const { return UserInfoChange; }
  bool UserInfoChangeEvent::isTransientDetail() const { return m_is_transient_detail; }

  // ============================================================================
  //  Search Result Event
  // ============================================================================

  /**
   *  Constructor for a SearchResultEvent
   */
00266   SearchResultEvent::SearchResultEvent(SearchResultEvent::SearchType t)
    : m_finished(false), m_expired(false), m_searchtype(t),
      m_last_contact(NULL), m_more_results(0)
  { }

  ContactRef SearchResultEvent::getLastContactAdded() const { return m_last_contact; }
  
  ContactList& SearchResultEvent::getContactList() { return m_clist; }
  
  void SearchResultEvent::setLastContactAdded(ContactRef c) { m_last_contact = c; }
  
  SearchResultEvent::SearchType SearchResultEvent::getSearchType() const { return m_searchtype; }
  
  bool SearchResultEvent::isFinished() const { return m_finished; }

  void SearchResultEvent::setFinished(bool b) { m_finished = b; }

  bool SearchResultEvent::isExpired() const { return m_expired; }
  
  void SearchResultEvent::setExpired(bool b) { m_expired = b; }

  unsigned int SearchResultEvent::getNumberMoreResults() const { return m_more_results; }
  
  void SearchResultEvent::setNumberMoreResults(unsigned int m) { m_more_results = m; }

  // ============================================================================
  //  Message Event
  // ============================================================================

  /**
   *  Constructor for a MessageEvent
   *
   * @param c the contact related to this event
   */
00300   MessageEvent::MessageEvent(ContactRef c)
    : m_contact(c)
  { }

  /**
   *  Destructor for MessageEvent
   */
00307   MessageEvent::~MessageEvent() { }

  /**
   *  get the contact related to the event
   *
   * @return the contact related to the event
   */
00314   ContactRef MessageEvent::getContact() { return m_contact; }

  /**
   *  get if a message event is finished.  This is used in the message
   *  ack'ing system.
   *
   * @return if message is finished
   */
00322   bool MessageEvent::isFinished() const { return m_finished; }

  /**
   *  get if a message event was delivered.  This is used in the
   *  message ack'ing system.
   *
   * @return if message was delivered
   */
00330   bool MessageEvent::isDelivered() const { return m_delivered; }

  /**
   *  get if a message event was sent direct.
   *  This is used in the message ack'ing system.
   *
   * @return if message was sent direct
   */
00338   bool MessageEvent::isDirect() const { return m_direct; }

  /**
   *  set whether the message has been finished.  This is used
   *  internally by the library and is of no interest to the client.
   *
   * @param f if message was finished
   */
00346   void MessageEvent::setFinished(bool f) { m_finished = f; }

  /**
   *  set whether the message has been delivered.
   * @param f if message was delivered
   */
00352   void MessageEvent::setDelivered(bool f) { m_delivered = f; }

  /**
   *  set whether the message has been sent direct.  This is used
   *  internally by the library and is of no interest to the client.
   *
   * @param f if message was sent direct
   */
00360   void MessageEvent::setDirect(bool f) { m_direct = f; }

  /**
   *  set the reason for delivery failure. Used to indicate the
   * failure reason when a client marks a message as not accepted (by
   * setDeliverd(false) in the messaged callback).
   *
   * @param d delivery failure reason
   */
00369   void MessageEvent::setDeliveryFailureReason(DeliveryFailureReason d)
  {
    m_failure_reason = d;
  }

  /**
   *  get the reason for delivery failure. Defined when getFinished ==
   *  false and getDelivered == false too.  This is used in the
   *  message ack'ing system.
   *
   * @return reason for delivery failing
   */
00381   MessageEvent::DeliveryFailureReason MessageEvent::getDeliveryFailureReason() const
  {
    return m_failure_reason;
  }

  // ============================================================================
  //  ICQ Message Event
  // ============================================================================

  /**
   *  Constructor for a ICQMessageEvent
   *
   * @param c the contact related to this event
   */
00395   ICQMessageEvent::ICQMessageEvent(ContactRef c)
    : MessageEvent(c), m_urgent(false), m_tocontactlist(false), m_offline(false)
  { }

  /**
   *  get whether the message was sent marked as urgent
   *
   * @return the urgency
   */
00404   bool ICQMessageEvent::isUrgent() const
  {
    return m_urgent;
  }

  /**
   *  set whether the message shall be marked as urgent
   * @param b urgent
   */
00413   void ICQMessageEvent::setUrgent(bool b)
  {
    m_urgent = b;
  }

  /**
   *  get whether the message was sent 'to contact list'
   *
   * @return whether message was to contact list
   */
00423   bool ICQMessageEvent::isToContactList() const
  {
    return m_tocontactlist;
  }

  /**
   *  set whether the message shall be marked as urgent
   */
00431   void ICQMessageEvent::setToContactList(bool b)
  {
    m_tocontactlist = b;
  }

  /**
   *  get if this was an offline message
   *
   * @return if this was an offline message
   */
00441   bool ICQMessageEvent::isOfflineMessage() const { return m_offline; }
    
  /**
   *  set whether this was an offline message
   */
00446   void ICQMessageEvent::setOfflineMessage(bool b) { m_offline = b; }
    
  /**
   *  get the uin of the sender.  This is really miss-named, if you
   *  were sending the message, this would be the UIN of the recipient.
   *
   * @return the uin
   */
00454   unsigned int ICQMessageEvent::getSenderUIN() const { return m_contact->getUIN(); }

  /**
   *  get the away message
   *
   * @return the away message
   */
00461   string ICQMessageEvent::getAwayMessage() const { return m_away_message; }

  /**
   *  set the away message
   *
   * @param msg the away message
   */
  void ICQMessageEvent::setAwayMessage(const string& msg) { m_away_message = msg; }

  // ============================================================================
  //  Normal Message
  // ============================================================================

  /**
   *  Construct a NormalMessageEvent.
   *
   * @param c the contact related to the event
   * @param msg the message
   * @param multi tag message as a multireceipt message
   */
  NormalMessageEvent::NormalMessageEvent(ContactRef c, const string& msg, bool multi)
    : ICQMessageEvent(c), m_message(msg), m_multi(multi),
      m_foreground(0x00000000), m_background(0x00ffffff) {
    setDirect(false);
  }

  /**
   *  Construct a NormalMessageEvent. This constructor is only used by the library.
   *
   * @param c the contact related to the event
   * @param msg the message
   * @param multi tag message as a multireceipt message
   * @param t the time the message was sent
   */
  NormalMessageEvent::NormalMessageEvent(ContactRef c, const string& msg, time_t t, bool multi)
    : ICQMessageEvent(c), m_message(msg), m_multi(multi),
      m_foreground(0x00000000), m_background(0x00ffffff) {
    setDirect(false);
    setOfflineMessage(true);
    m_time = t;
  }

  /**
   *  Construct a NormalMessageEvent.
   *
   * @param c the contact related to the event
   * @param msg the message
   * @param fg foreground colour for the message
   * @param bg background colour for the message
   */
  NormalMessageEvent::NormalMessageEvent(ContactRef c, const string& msg, unsigned int fg, unsigned int bg)
    : ICQMessageEvent(c), m_message(msg), m_multi(false) /* todo */,
      m_foreground(fg), m_background(bg) {
    setDirect(true);
  }

00517   MessageEvent::MessageType NormalMessageEvent::getType() const { return MessageEvent::Normal; }
  
  /**
   *  get the message
   *
   * @return the message
   */
00524   string NormalMessageEvent::getMessage() const { return m_message; }

  /**
   *  get if the message is a multiparty message
   *
   * @return if the message is a multiparty message
   */
00531   bool NormalMessageEvent::isMultiParty() const { return m_multi; }

  /**
   *  get the foreground colour of the message
   *
   * @return foreground colour of the message
   */
00538   unsigned int NormalMessageEvent::getForeground() const { return m_foreground; }

  /**
   *  get the background colour of the message
   *
   * @return background colour of the message
   */
00545   unsigned int NormalMessageEvent::getBackground() const { return m_background; }

  /**
   *  set the foreground colour of the message
   *
   * @param f foreground colour of the message
   */
00552   void NormalMessageEvent::setForeground(unsigned int f) { m_foreground = f; }

  /**
   *  set the background colour of the message
   *
   * @param b background colour of the message
   */
00559   void NormalMessageEvent::setBackground(unsigned int b) { m_background = b; }

  ICQMessageEvent* NormalMessageEvent::copy() const
  {
    return new NormalMessageEvent(*this);
  }

  // ============================================================================
  //  URL Message
  // ============================================================================

  /**
   *  Construct an URLMessageEvent
   *
   * @param c the contact related to the event
   * @param msg the message
   * @param url the url
   */
  URLMessageEvent::URLMessageEvent(ContactRef c, const string& msg, const string& url)
    : ICQMessageEvent(c), m_message(msg), m_url(url) { }

  /**
   *  Construct an URLMessageEvent. This constructor is only used by the library.
   *
   * @param c the contact related to the event
   * @param msg the message
   * @param url the url
   * @param t time of sending
   */
  URLMessageEvent::URLMessageEvent(ContactRef c, const string& msg, const string& url, time_t t)
    : ICQMessageEvent(c), m_message(msg), m_url(url) {
    setOfflineMessage(true);
    m_time = t;
  }

00594   MessageEvent::MessageType URLMessageEvent::getType() const { return MessageEvent::URL; }
  
  /**
   *  get the message
   *
   * @return the message
   */
00601   string URLMessageEvent::getMessage() const { return m_message; }

  /**
   *  get the url
   *
   * @return the url
   */
00608   string URLMessageEvent::getURL() const { return m_url; }

  ICQMessageEvent* URLMessageEvent::copy() const
  {
    return new URLMessageEvent(*this);
  }

  // ============================================================================
  //  SMS Message
  // ============================================================================

  /**
   *  Construct an SMSMessageEvent.
   *
   * @param c the source contact
   * @param msg the message
   * @param source the source (service)
   * @param senders_network the senders network
   * @param time the time of sending
   *
   * @todo fix parsing of time
   */
  SMSMessageEvent::SMSMessageEvent(ContactRef c, const string& msg, const string& source,
                           const string& senders_network, const string& time)
    : MessageEvent(c), m_message(msg), m_source(source),
      m_senders_network(senders_network) {
    // fix: m_time = time;
  }

  /**
   *  Construct an SMSMessageEvent
   *
   * @param c the destination contact
   * @param msg the message
   * @param rcpt whether to request a delivery receipt
   */
  SMSMessageEvent::SMSMessageEvent(ContactRef c, const string& msg, bool rcpt)
    : MessageEvent(c), m_message(msg), m_rcpt(rcpt) { }

00647   MessageEvent::MessageType SMSMessageEvent::getType() const { return MessageEvent::SMS; }
  

  /**
   *  get the message
   *
   * @return the message
   */
00655   string SMSMessageEvent::getMessage() const { return m_message; }

  /**
   *  get the source
   *
   * @return the source
   */
00662   string SMSMessageEvent::getSource() const { return m_source; }

  /**
   *  get the sender (mobile no)
   *
   * @return the sender
   */
00669   string SMSMessageEvent::getSender() const { return m_contact->getMobileNo(); }

  /**
   *  get the senders network
   *
   * @return the senders network
   */
00676   string SMSMessageEvent::getSenders_network() const { return m_senders_network; }

  /**
   *  get if a receipt was requested
   *
   * @return if a receipt was requested
   */
00683   bool SMSMessageEvent::getRcpt() const { return m_rcpt; }

  void SMSMessageEvent::setSMTPFrom(const string& from) { m_smtp_from = from; }

  string SMSMessageEvent::getSMTPFrom() const { return m_smtp_from; }

  void SMSMessageEvent::setSMTPTo(const string& to) { m_smtp_to = to; }

  string SMSMessageEvent::getSMTPTo() const { return m_smtp_to; }

  void SMSMessageEvent::setSMTPSubject(const string& subj) { m_smtp_subject = subj; }

  string SMSMessageEvent::getSMTPSubject() const { return m_smtp_subject; }

  // ============================================================================
  //  SMS Receipt Event
  // ============================================================================

  /**
   *  Construct an SMSReceiptEvent
   *
   * @param c the source contact
   * @param msg the message
   * @param message_id the message id
   * @param submission_time time of submission
   * @param delivery_time time of delivery
   * @param del if the message was delivered
   */
  SMSReceiptEvent::SMSReceiptEvent(ContactRef c, const string& msg, const string& message_id,
                           const string& submission_time, const string& delivery_time, bool del)
    : MessageEvent(c), m_message(msg), m_message_id(message_id),
      m_submission_time(submission_time), m_delivery_time(delivery_time), m_delivered(del) { }
    
00716   MessageEvent::MessageType SMSReceiptEvent::getType() const { return MessageEvent::SMS_Receipt; }

  /**
   *  get the message
   *
   * @return the message
   */
00723   string SMSReceiptEvent::getMessage() const { return m_message; }

  /**
   *  get the message id
   *
   * @return the message id
   */
00730   string SMSReceiptEvent::getMessageId() const { return m_message_id; }

  /**
   *  get the destination mobile no
   *
   * @return the destination mobile no
   */
00737   string SMSReceiptEvent::getDestination() const { return m_contact->getMobileNo(); }

  /**
   *  get the submission time
   *
   * @return the submission time
   */
00744   string SMSReceiptEvent::getSubmissionTime() const { return m_submission_time; }

  /**
   *  get the delivery time
   *
   * @return the delivery time
   */
00751   string SMSReceiptEvent::getDeliveryTime() const { return m_delivery_time; }

  /**
   *  get if the message was delivered
   *
   * @return if the message was delivered
   */
00758   bool SMSReceiptEvent::delivered() const { return m_delivered; }


  // ============================================================================
  //  Away Message
  // ============================================================================

  /**
   *  Construct an Away message
   *
   * @param c the contact
   */
00770   AwayMessageEvent::AwayMessageEvent(ContactRef c)
    : ICQMessageEvent(c) { }

00773   MessageEvent::MessageType AwayMessageEvent::getType() const { return MessageEvent::AwayMessage; }

  ICQMessageEvent* AwayMessageEvent::copy() const
  {
    return new AwayMessageEvent(*this);
  }

  // ============================================================================
  //  Authorisation Request
  // ============================================================================

  /**
   *  Constructor for the Authorisation Request
   *
   * @param c the contact
   * @param msg authorisation message
   */
  AuthReqEvent::AuthReqEvent(ContactRef c, const string& msg)
    : ICQMessageEvent(c), m_message(msg) {}
    
  /**
   *  Constructor for the Authorisation Request
   *
   * @param c the contact
   * @param msg authorisation message
   */
  AuthReqEvent::AuthReqEvent(ContactRef c, const string& msg, time_t t)
    : ICQMessageEvent(c), m_message(msg) {
    setOfflineMessage(true);
    m_time = t;  
  }

00805   MessageEvent::MessageType AuthReqEvent::getType() const { 
    return MessageEvent::AuthReq; 
  }
  
  /**
   *  get the authorisation message
   *
   * @return authorisation message
   */
00814   string AuthReqEvent::getMessage() const { return m_message; }

  ICQMessageEvent* AuthReqEvent::copy() const
  {
    return new AuthReqEvent(*this);
  }

  // ============================================================================
  //  Authorisation Acknowledgement
  // ============================================================================

  /**
   *  Constructor for the Authorisation Acknowledgement
   *
   * @param c the contact
   * @param granted if authorisation was granted
   */
00831   AuthAckEvent::AuthAckEvent(ContactRef c, bool granted)
    : ICQMessageEvent(c), m_granted(granted) {}
      
  /**
   *  Constructor for the Authorisation Acknowledgement
   *
   * @param c the contact
   * @param msg the authorisation message
   * @param granted if authorisation was granted
   */
  AuthAckEvent::AuthAckEvent(ContactRef c, const string& msg, bool granted)
    : ICQMessageEvent(c),  m_message(msg), m_granted(granted) {}
      
  /**
   *  Constructor for the Authorisation Acknowledgement
   *
   * @param c the contact
   * @param granted if authorisation was granted
   * @param t time the message was sent
   */
00851   AuthAckEvent::AuthAckEvent(ContactRef c, bool granted, time_t t)
    : ICQMessageEvent(c), m_granted(granted) {
    setOfflineMessage(true);
    m_time = t;
  }

  /**
   *  Constructor for the Authorisation Acknowledgement
   *
   * @param c the contact
   * @param msg the authorisation message
   * @param granted if authorisation was granted
   * @param t time the message was sent
   */
  AuthAckEvent::AuthAckEvent(ContactRef c, const string& msg,
                             bool granted, time_t t)
    : ICQMessageEvent(c), m_message(msg), m_granted(granted) {
    setOfflineMessage(true);
    m_time = t;
  }
  
00872   MessageEvent::MessageType AuthAckEvent::getType() const { 
    return MessageEvent::AuthAck; 
  }

  /**
   *  get if the authorisation was granted
   *
   * @return if the authorisation was granted
   */
00881   bool AuthAckEvent::isGranted() const { 
    return m_granted; 
  }
  
  /**
   *  get the authorisation message
   *
   * @return the authorisation message
   */
00890   string AuthAckEvent::getMessage() const { return m_message; }

  ICQMessageEvent* AuthAckEvent::copy() const
  {
    return new AuthAckEvent(*this);
  }

  // ============================================================================
  //  E-mail Express message
  // ============================================================================

  EmailExEvent::EmailExEvent(ContactRef c, const string &email,
                       const string &sender, const string &msg)
  : MessageEvent(c), m_sender(sender), m_email(email), m_message(msg) {
  }

  string EmailExEvent::getMessage() const { return m_message; }

  string EmailExEvent::getEmail() const { return m_email; }

  string EmailExEvent::getSender() const { return m_sender; }

00912   MessageEvent::MessageType EmailExEvent::getType() const { return MessageEvent::EmailEx; }

  // ============================================================================
  //  Web Pager message
  // ============================================================================

  WebPagerEvent::WebPagerEvent(ContactRef c, const string& email,
                         const string& sender, const string& msg)
    : MessageEvent(c), m_sender(sender), m_email(email), m_message(msg)
  { }

  string WebPagerEvent::getMessage() const { return m_message; }

  string WebPagerEvent::getEmail() const { return m_email; }

  string WebPagerEvent::getSender() const { return m_sender; }

00929   MessageEvent::MessageType WebPagerEvent::getType() const { return MessageEvent::WebPager; }

  // ============================================================================
  //  "You were added" message
  // ============================================================================

  UserAddEvent::UserAddEvent(ContactRef c) : ICQMessageEvent(c) { }

00937   MessageEvent::MessageType UserAddEvent::getType() const { return MessageEvent::UserAdd; }

00939   unsigned int UserAddEvent::getSenderUIN() const { return m_contact->getUIN(); }

  ICQMessageEvent* UserAddEvent::copy() const
  {
    return new UserAddEvent(*this);
  }

  // ============================================================================
  //  Email Message
  // ============================================================================

  EmailMessageEvent::EmailMessageEvent(ContactRef c, const string &msg)
  : MessageEvent(c), m_message(msg) {
  }

  string EmailMessageEvent::getMessage() const { return m_message; }

00956   EmailMessageEvent::MessageType EmailMessageEvent::getType() const { return MessageEvent::Email; }

  // ============================================================================
  //  New UIN
  // ============================================================================

  /**
   *  Constructor for a NewUINEvent
   *
   * @param uin your new uin
   * @param success if registration was successful
   */
00968   NewUINEvent::NewUINEvent(unsigned int uin, bool success) 
    : m_uin(uin), m_success(success) { }

  /**
   *  get your new uin
   *
   * @return the new uin
   */
00976   unsigned int NewUINEvent::getUIN() const { return m_uin; }

  /**
   *  get if registration was a success
   *
   * @return if registration was a success
   */
00983   bool NewUINEvent::isSuccess() const { return m_success; }


  // ============================================================================
  //  Rate Info Change
  // ============================================================================

  /**
   *  Constructor for a RateInfoChangeEvent
   *
   * @param code the code
   * @param rateclass the rateclass
   * @param windowsize the size of the window
   * @param clear clear (?)
   * @param alert alert (?)
   * @param limit the limit
   * @param disconnect disconnect (?)
   * @param currentavg the current average
   * @param maxavg the maximum average
   */
01003   RateInfoChangeEvent::RateInfoChangeEvent(unsigned short code, 
                                           unsigned short rateclass,
                                           unsigned int windowsize,
                                           unsigned int clear,
                                           unsigned int alert,
                                           unsigned int limit,
                                           unsigned int disconnect,
                                           unsigned int currentavg,
                                           unsigned int maxavg) 
    : m_code(code), m_rateclass(rateclass), m_windowsize(windowsize),
      m_clear(clear), m_alert(alert), m_limit(limit), m_disconnect(disconnect), 
      m_currentavg(currentavg), m_maxavg(maxavg) { }



}

Generated by  Doxygen 1.6.0   Back to index