Class: SkypeR::Object::User

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

Overview

USER object

NB! When you retrieve USER object records with SEARCH USERS command, the user profile data is guaranteed to be accessible with GET USER <user_id> <property_name> commands only until another SEARCH command is executed. The reason for this is that big SEARCH commands can and often trigger Skype’s internal garbage collection routine that can clear out the data retreived by previous searches.

The user object has the following properties:

* HANDLE - username, for example: USER pamela HANDLE pamela .
* FULLNAME - user's full name, for example: USER pamela FULLNAME Jane Doe .
* BIRTHDAY - user's birth date in YYYYMMDD format, for example: USER bitman BIRTHDAY 19780329 .
* SEX - example: USER pamela SEX UNKNOWN . Values:
      o UNKNOWN - user has not specified sex in personal profile.
      o MALE
      o FEMALE 
* LANGUAGE - name of language, for example: USER mike LANGUAGE English . In protocol 4 with the ISO 639 prefix, example: USER mike LANGUAGE en English .
* COUNTRY - name of country, for example: USER mike COUNTRY Estonia . In protocol 4 with the ISO 3166 prefix, example: USER mike COUNTRY ee Estonia .
* PROVINCE - example: USER mike PROVINCE Harjumaa .
* CITY - example: USER mike CITY Tallinn .
* PHONE_HOME - example: USER mike PHONE_HOME 3721111111 .
* PHONE_OFFICE - example: USER mike PHONE_OFFICE 3721111111 .
* PHONE_MOBILE - example: USER mike PHONE_MOBILE 3721111111 .
* HOMEPAGE - example: USER mike HOMEPAGE http://www.joltid.com .
* ABOUT - example: USER mike ABOUT I am a nice person .
* HASCALLEQUIPMENT - always returns TRUE . Example: USER pamela HASCALLEQUIPMENT TRUE .
* IS_VIDEO_CAPABLE - possible values: True or False
* IS_VOICEMAIL_CAPABLE - possible values: True or False
* BUDDYSTATUS - example: USER pamela BUDDYSTATUS 2 . Possible BUDDYSTATUS values:
      o 0 - never been in contact list.
      o 1 - deleted from contact list. (read-write)
      o 2 - pending authorisation. (read-write)
      o 3 - added to contact list. 
* ISAUTHORIZED - (read-write) is user authorized by current user? Example: USER pamela ISAUTHORIZED TRUE . Values:
      o TRUE
      o FALSE 
* ISBLOCKED - (read-write) is user blocked by current user? Example: USER spammer ISBLOCKED TRUE . Values:
      o TRUE
      o FALSE 
* ONLINESTATUS - user online status, for example: USER mike ONLINESTATUS ONLINE . Possible values:
      o UNKNOWN - unknown user.
      o OFFLINE - user is offline (not connected). Will also be returned if current user is not authorized by other user to see his/her online status.
      o ONLINE - user is online.
      o AWAY - user is away (has been inactive for certain period).
      o NA - user is not available.
      o DND - user is in "Do not disturb" mode. 
* SkypeOut - user is in the SkypeOut contact list.
* SKYPEME (Protocol 2)
* LASTONLINETIMESTAMP - UNIX timestamp, available only for offline user. Example USER mike LASTONLINETIMESTAMP 1078959579 .
* CAN_LEAVE_VM - is it possible to send voicemail to user? Example: USER test CAN_LEAVE_VM TRUE . Possible values:
      o TRUE
      o FALSE 
* SPEEDDIAL - (read-write) speeddial code assigned to user.
* RECEIVEDAUTHREQUEST - text message for authorization request; available only when user asks for authorization.
* MOOD_TEXT - mood text for user (mood text is only visible to authorised users; visible in Skype for Windows 2.0).
* RICH_MOOD_TEXT - advanced version of user's mood message. See SET PROFILE RICH_MOOD_TEXT command for more information. Introduced in API version 3.0
* ALIASES <text> - list of assigned aliases (aliases are only visible as a result of a direct match for alias search).
* TIMEZONE <offset> - time offset from GMT in minutes; visible in Skype for Windows 2.0.
* IS_CF_ACTIVE - whether the user has Call Forwarding activated or not. Possible values:
      o TRUE
      o FALSE 
* NROF_AUTHED_BUDDIES - Stores the number of authorized contacts in the contact list.

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

* BUDDYSTATUS
      o 1 - delete from buddylist
      o 2 - add user into contactlist and ask for authorization: SET USER echo123 BUDDYSTATUS 2 Please authorize me 
* ISBLOCKED
      o TRUE - block user
      o FALSE - unblock user 
* ISAUTHORIZED
      o TRUE - authorize user
      o FALSE - dismiss authorization for user 
* SPEEDDIAL - speeddial code assigned to user
* DISPLAYNAME - By default this property is empty. If a value is assigned to this property with SET <skypename> DISPLAYNAME <value> then that value will be displayed in Skype UI instead of user's FULLNAME.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#update_attributes

Constructor Details

#initialize(args = {}) ⇒ User

Returns a new instance of User.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/skyper/object.rb', line 98

def initialize(args={})
  @handle = args[:handle] if args[:handle]
  args[:property]
  @fullname = args[:fullname] if args[:fullname]
  @birthday = args[:birthday] if args[:birthday]
  @sex = args[:sex] if args[:sex]
  @language = args[:language] if args[:language]
  @country = args[:country] if args[:country]
  @buddystatus = args[:buddystatus] if args[:buddystatus]
  @isauthorized = args[:isauthorized] if args[:isauthorized]
  @isblocked = args[:isblocked] if args[:isblocked]
  @onlinestatus = args[:onlinestatus] if args[:onlinestatus]
  @lastonlinetimestamp = args[:lastonlinetimestamp] if args[:lastonlinetimestamp]
  @can_leave_vm = args[:can_leave_vm] if args[:can_leave_vm]
end

Instance Attribute Details

#birthdayObject

Returns the value of attribute birthday.



97
98
99
# File 'lib/skyper/object.rb', line 97

def birthday
  @birthday
end

#buddystatusObject

Returns the value of attribute buddystatus.



97
98
99
# File 'lib/skyper/object.rb', line 97

def buddystatus
  @buddystatus
end

#can_leave_vmObject

Returns the value of attribute can_leave_vm.



97
98
99
# File 'lib/skyper/object.rb', line 97

def can_leave_vm
  @can_leave_vm
end

#countryObject

Returns the value of attribute country.



97
98
99
# File 'lib/skyper/object.rb', line 97

def country
  @country
end

#fullnameObject

Returns the value of attribute fullname.



97
98
99
# File 'lib/skyper/object.rb', line 97

def fullname
  @fullname
end

#handleObject

Returns the value of attribute handle.



97
98
99
# File 'lib/skyper/object.rb', line 97

def handle
  @handle
end

#isauthorizedObject

Returns the value of attribute isauthorized.



97
98
99
# File 'lib/skyper/object.rb', line 97

def isauthorized
  @isauthorized
end

#isblockedObject

Returns the value of attribute isblocked.



97
98
99
# File 'lib/skyper/object.rb', line 97

def isblocked
  @isblocked
end

#languageObject

Returns the value of attribute language.



97
98
99
# File 'lib/skyper/object.rb', line 97

def language
  @language
end

#lastonlinetimestampObject

Returns the value of attribute lastonlinetimestamp.



97
98
99
# File 'lib/skyper/object.rb', line 97

def lastonlinetimestamp
  @lastonlinetimestamp
end

#onlinestatusObject

Returns the value of attribute onlinestatus.



97
98
99
# File 'lib/skyper/object.rb', line 97

def onlinestatus
  @onlinestatus
end

#sexObject

Returns the value of attribute sex.



97
98
99
# File 'lib/skyper/object.rb', line 97

def sex
  @sex
end

Instance Method Details

#execute(statement) ⇒ Object



114
115
116
117
118
# File 'lib/skyper/object.rb', line 114

def execute(statement)
  application = SkypeR::Service::Application.new('test', 'log/iskype.log')
  command = SkypeR::Service::CommandMessage.new(statement)
  application.invoke(command)
end