Class: SkypeR::Object::ChatMessage

Inherits:
Base
  • Object
show all
Defined in:
lib/skyper/object.rb

Overview

CHATMESSAGE object

Version

* Protocol 3. Supersedes the MESSAGE object. Updated in protocol 7. Note that when your application connects to Skype, "PROTOCOL 7" command must be sent to Skype before your client can recognize new message types added in protocol 7. Connecting with default protocol (protocol 1) will cause new message types being reported as UNKNOWN.

Properties

* TIMESTAMP - time when message was sent (UNIX timestamp), for example MESSAGE 21 TIMESTAMP 1078958218
* PARTNER_HANDLE - NB! This property is deprecated since API version 3.0 and replaced with FROM_HANDLE.
* PARTNER_DISPNAME - NB! This property is deprecated since API version 3.0 and replaced with FROM_DISPNAME.
* FROM_HANDLE - skypename of the originator of the chatmessage.
* FROM_DISPNAME - displayed name of the originator of the chatmessage.
* TYPE - message type, for example MESSAGE 21 TYPE TEXT . Possible values:
      o SETTOPIC - change of chat topic
      o SAID - IM
      o ADDEDMEMBERS - invited someone to chat
      o SAWMEMBERS - chat participant has seen other members
      o CREATEDCHATWITH - chat to multiple people is created
      o LEFT - someone left chat; can also be a notification if somebody cannot be added to chat
      o POSTEDCONTACTS - system message that is sent or received when one user sends contacts to another. Added in protocol 7.
      o GAP_IN_CHAT - messages of this type are generated locally, during synchronization, when a user enters a chat and it becomes apparent that it is impossible to update user's chat history completely. Chat history is kept only up to maximum of 400 messages or 2 weeks. When a user has been offline past that limit, GAP_IN_CHAT notification is generated. Added in protocol 7.
      o SETROLE - system messages that are sent when a chat member gets promoted or demoted. Refer to ALTER CHATMEMBER SETROLETO command for more info on how to change chat member roles. Added in protocol 7.
      o KICKED - system messages that are sent when a chat member gets kicked. Refer to ALTER CHAT KICK command for more information. Added in protocol 7.
      o KICKBANNED - system messages that are sent when a chat member gets banned. Refer to ALTER CHAT KICKBAN command for more information. Added in protocol 7.
      o SETOPTIONS - system messages that are sent when chat options are changed. Refer to ALTER CHAT SETOPTIONS command for more information. Added in protocol 7.
      o SETPICTURE - system messages that are sent when a chat member has changed the public chat topic picture. Added in protocol 7.
      o SETGUIDELINES - system messages that are sent when chat guidelines are changed. Refer to ALTER CHAT SETGUIDELINES command for more information. Added in protocol 7.
      o JOINEDASAPPLICANT - notification message that gets sent in a public chat with JOINERS_BECOME_APPLICANTS options, when a new user joins the chat. See ALTER CHAT SETOPTIONS command for more information on chat options. Added in protocol 7.
      o UNKNOWN - unknown message type, possibly due to connecting to Skype with older protocol. 
* STATUS - message status, for example MESSAGE 21 STATUS QUEUED . Possible values:
      o SENDING - message is being sent
      o SENT - message was sent
      o RECEIVED - message has been received
      o READ - message has been read 
* LEAVEREASON - used with LEFT type message, for example CHATMESSAGE 21 LEAVEREASON UNSUBSCRIBE . Possible values:
      o USER_NOT_FOUND - user was not found
      o USER_INCAPABLE - user has an older Skype version and cannot join multichat
      o ADDER_MUST_BE_FRIEND - recipient accepts messages from contacts only and sender is not in his/her contact list
      o ADDED_MUST_BE_AUTHORIZED - recipient accepts messages from authorized users only and sender is not authorized
      o UNSUBSCRIBE - participant left chat 
* CHATNAME - chat that includes the message, for example #test_3/$b17eb511457e9d20
* USERS - people added to chat
* IS_EDITABLE - TRUE|FALSE Refer to SET CHATMESSAGE BODY command for more information on how to edit chat message text (BODY) and on what conditions is such editing permitted. This property was introduced in API version 3.0
* EDITED_BY - identity of the last user who edited the message. New in API version 3.0
* EDITED_TIMESTAMP - UNIX timestamp of the last edit. New in API version 3.0
* OPTIONS - numeric field that contains chat options bitmap in system messages that get sent out when a change is made to chat options (messages where TYPE is SETOPTIONS). In normal messages the value of this field is 0. Refer to ALTER CHAT SETOPTIONS command for more information.
* ROLE - used in system messages that get sent when a public chat administrator has promoted or demoted a chat member. The TYPE property of such messages is set to SETROLE. In these messages the value of this field is set to the new assigned role of the promoted or demoted chat member. In normal messages the value of this property is set to UNKNOWN. Refer to CHAT ROLES section for a list of different chat roles and ALTER CHATMEMBER SETROLETO command for how chat roles can be changed. New in API version 3.0

Most chatmessage properties are read-only. The following property is read-write and can be modified with the SET command:

* SEEN - mark missed chatmessage as seen and removes chat from missed events.
* BODY - message text. Note that this property was read-only prior to API version 3.0

Instance Method Summary collapse

Methods inherited from Base

#update_attributes

Constructor Details

#initialize(args = {}) ⇒ ChatMessage

Returns a new instance of ChatMessage.



401
402
403
404
405
406
407
# File 'lib/skyper/object.rb', line 401

def initialize(args={})
  @timestamp = args[:timestamp] if args[:timestamp]
  @from_handle = args[:from_handle] if args[:from_handle]
  @status = args[:from_handle] if args[:status] # SENDING | SENT | RECEIVED | READ
  @body = args[:from_handle] if args[:body]
  raise "deprecated"  if args[:partner_handle]
end