| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
skypekit.Cached --+
|
skypekit.Object --+
|
Message
Events in a conversation context are expressed as Messages. It is therefore useful to think of Message objects as events, rather than specifically text chat messages.
Message member functions all return a Boolean indicating the success (true) or failure (false) of processing the request itself (transport, runtime availability, and so forth) - not the success or failure of its associated functionality. For example, Message::Edit returns true if it was able to make a determination, and its result parameter reflects whether this Message can be edited. Similarly, Message::Edit returns false if it was unable to make a determination, and the value of its result parameter is undefined.
Message member functions that are specific to a Message TYPE return false if this Message is not of that type. For example, Message::GetVoiceMessage will return false if this Message's type is not POSTED_VOICE_MESSAGE.
The actual meaning of a Message can be determined by its P_TYPE property. The meanings of most other Message properties depend on the value of P_TYPE. For example, let's take P_BODY_XML property.
Following messages have a text entered by the user as a body. It may contain emoticons, URLs, etc.
Following messages have a custom XML format for the body (see the specific section on these message types for details):
Following messages do not use the body property:
Messages such as POSTED_TEXT use a small subset of a HTML-like markup to control the visual representation of the text. This markup is used by POSTED_TEXT and POSTED_EMOTE, but also for the conversation topic (CONVERSATION_META_TOPIC property and the body of the SET_METADATA message) and for authorization requests.
Having chat messages in XML format means that all formatting is indicated by XML tags. This includes emoticons and URls. The big advantage is that it makes the parsing of the message by the UI much easier. The UI does not need to do emoticons or URL detection, this is already done and it only needs to look for the XML tags.
For text messages, it is possible for the UI to simply ignore (meaning strip) the XML and the message will be understandable fine, it will only have lost some formatting.
But it is obviously nicer to display at least the most commonly used tags.
To strip the XML:
Skype for Windows supports displaying many XML tags, but only a sub-set is regularly used and should be supported by the UI for a good experience. These are the ones described here. Animated emoticons Emoticons are encoded with the "ss" tag. The element content is the plain text representation. It has a "type" attribute indicating the emoticons canonical name. Example: :
Hi <ss type="smile">:-)</ss>
Flag emoticons Flag emoticons are little flags. They are encoded with the "flag" tag. The element contents is the plain text representation and it has a "country" attribute which is a 2-letter ISO-3166 country code. The user can enter a flag using "(flag:XX)", where XX is a valid ISO country code. Example: :
I am in <flag country="cc">CC</flag>
Links If the library detects a URL, it will encode it using the html "a" tag, with the "href" attribute indicating the URL. The plain text representation is what the user originally typed. Example: :
I am in <a href="http://wwww.skype.com">www.skype.com</a>
Alert matches When a conversation is configured to display only alerts if specific words are present in the message (see "/alertson [text to match]" command), if a message matches the alert, it will be marked with the <alertmatch> tag. This allows the UI to highlight the word matching. Example: :
Maybe <alertmatch>Vincent</alertmatch> knows the answer
Bold, italic, etc Skype for Windows also supports displaying bold and italic text, using the "b" and "i" tags.
Encoding messages When sending a chat message via PostText(), there is the possibility to indicate if the library should do the XML encoding, or if the message has already been encoded. Usually, the UI can let library do the encoding. This is the case when the message does not contain any specific formatting. It may contain emoticons or URls, which will be detected by the library encoder and converted into XML tags. If the message has some more complex encoding, such as a quote or some bold text, it is up to the UI to encode the message.
| Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
| Static Methods | |||
|
|||
|
Inherited from |
|||
| Class Variables | |
event_handlers =
|
|
propid2label =
|
|
module_id = 9
|
|
TYPE = The P_TYPE property determines the actual meaning of the Message object. |
|
SENDING_STATUS = SENDING - Message has not been delivered to at least one of the participants |
|
CONSUMPTION_STATUS = Indicates if a message has been consumed (meaning read) or not |
|
SET_METADATA_KEY = For messages of type SET_METADATA that alert participants to changes to the associated Conversation's metadata, indicates which metadata property changed and its P_BODY_XML property contains the changed data. |
|
LEAVEREASON = Indicates the reason a user could not join or left a Conversation. |
|
P_CONVO_ID = 960
|
|
P_CONVO_GUID = 120
|
|
P_AUTHOR = 122
|
|
P_AUTHOR_DISPLAYNAME = 123
|
|
P_GUID = 792
|
|
P_ORIGINALLY_MEANT_FOR = 790
|
|
P_TIMESTAMP = 121
|
|
P_TYPE = 961
|
|
P_SENDING_STATUS = 962
|
|
P_CONSUMPTION_STATUS = 968
|
|
P_EDITED_BY = 222
|
|
P_EDIT_TIMESTAMP = 223
|
|
P_PARAM_KEY = 963
|
|
P_PARAM_VALUE = 964
|
|
P_BODY_XML = 127
|
|
P_IDENTITIES = 125
|
|
P_REASON = 966
|
|
P_LEAVEREASON = 126
|
|
P_PARTICIPANT_COUNT = 982
|
|
|
Inherited from |
|
| Instance Variables | |
|
Inherited from |
| Properties | |
|
convo_id DB ID of corresponding conversation |
|
|
convo_guid GUID of the Conversation. |
|
|
author Identity of the sender. |
|
|
author_displayname displayname of the sender at the time of posting |
|
|
guid Unlike the message id, the GUID is the same on all instances and for all participants. |
|
|
originally_meant_for This property gets set when a conference is spawned from dialog Conversation. |
|
|
timestamp UNIX timestamp (sent time, adjusted for local clock) |
|
| type | |
| sending_status | |
| consumption_status | |
|
edited_by Identity of the author that last edited this message. |
|
|
edit_timestamp UNIX timestamp of last edit |
|
|
param_key Message type-specific parameter. |
|
|
param_value Message type-specific parameter |
|
|
body_xml Message type-specific parameter |
|
|
identities Message type-specific parameter. |
|
|
reason Message type-specific parameter. |
|
|
leavereason Leave reason for message of the RETIRED type, and STARTED/ENDED_LIVESESSION. |
|
|
participant_count Number of people who received this message (including local user) |
|
|
Inherited from |
|
| Method Details |
actual constructor
|
str(x)
|
For Message types having a body, determines whether that body is editable by the user. Return values:
|
For Message types that include a body and are editable:
Arguments:
|
For messages of type POSTED_CONTACTS, parses the body XML and formats the data as a list of Contact instances. Return values:
|
For messages of type POSTED_FILES, parses the body XML and creates a list of Transfer instances. Return values:
|
For messages of type POSTED_VOICE_MESSAGE, parses the body XML and creates a Voicemail instance. Return values:
|
For messages of type POSTED_SMS, parses the body XML and creates an SMS instances Return values:
|
Deletes this message from the local database. These deletions do not propagate to the other Skype instances that the user may have on other computers. Nor do they affect other participants that have the same message. This method is specifically from removing Message objects from the database - not for removing Messages from conversations. To remove a Message from a conversation, use Message::Edit method to replace the existing body text with an empty string. |
| Class Variable Details |
propid2label
|
TYPEThe P_TYPE property determines the actual meaning of the Message object. Only Messages of POSTED_TEXT type contain actual text messages. The meaning and content of the rest of the message properties are largely dependant of the value of the Message::P_TYPE.
|
SENDING_STATUS
|
CONSUMPTION_STATUSIndicates if a message has been consumed (meaning read) or not
|
SET_METADATA_KEYFor messages of type SET_METADATA that alert participants to changes to the associated Conversation's metadata, indicates which metadata property changed and its P_BODY_XML property contains the changed data. Your UI is expected to detect messages with PARAM_KEY set and to update its visual representation of Conversation accordingly. You can use the associated Conversation's properties and methods to obtain the updated metadata rather than parse the message body XML, for example, Conversation::P_META_PICTURE and Conversation::Conversation::GetPropMetaPicture.
|
LEAVEREASONIndicates the reason a user could not join or left a Conversation. SkypeKit automatically sets "could not join"-related values. "Left voluntarily"-related values are set as a result of explicit user actions.
|
| Property Details |
convo_idDB ID of corresponding conversation
|
convo_guidGUID of the Conversation. The GUID is a "global ID" - these values are shared accross Skype client instances and accross all the participants of the conversation.
|
authorIdentity of the sender. While this is almost always the same as SKYPENAME property of the Contact, in some rare cases it can also be a phone number - for example, incoming voicemail notification Messages (message type = POSTED_VOICE_MESSAGE).
|
author_displaynamedisplayname of the sender at the time of posting
|
guidUnlike the message id, the GUID is the same on all instances and for all participants.
|
originally_meant_forThis property gets set when a conference is spawned from dialog Conversation. In that case recent message history from the original dialog is copied to the target conversation. For all the copied messages, the ORIGINALLY_MEANT_FOR property will be set to identity of the remote participant of the original dialog.
|
timestampUNIX timestamp (sent time, adjusted for local clock)
|
type
|
sending_status
|
consumption_status
|
edited_byIdentity of the author that last edited this message. NULL if message has not been edited
|
edit_timestampUNIX timestamp of last edit
|
param_keyMessage type-specific parameter. See Message::SET_METADATA_KEY for more information.
|
param_valueMessage type-specific parameter
|
body_xmlMessage type-specific parameter
|
identitiesMessage type-specific parameter. Depending of Message type, this property contains:
|
reasonMessage type-specific parameter. Possible values for STARTED/ENDED_LIVESESSION (only set for dialogs):
This information is now available as an enum in LEAVEREASON
|
leavereasonLeave reason for message of the RETIRED type, and STARTED/ENDED_LIVESESSION. Use for STARTED/ENDED_LIVESESSION is to provide simpler, enum based handling and deprecates the reason property (only set for dialogs)
|
participant_countNumber of people who received this message (including local user)
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Jan 27 18:21:13 2012 | http://epydoc.sourceforge.net |