Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
The google.appengine.api.xmpp
package provides the following functions:
Queries the presence status of a Google Talk user.
Arguments:
example@gmail.com
. Can be a @gmail.com
JID, or a JID using a Google Apps domain.app-id@appspot.com
or match the pattern anything@app-id.appspotchat.com
. If None
, defaults to app-id@appspot.com
.True
, this function will return a tuple consisting of (availability
, show
). The first value in the tuple will be True
if the user is online and available, and False
if the user is not online or away. The second value is a String corresponding to a PRESENCE_SHOW_
value as defined in the xmpp
module and XMPP RFC 3921.
If False
this function will return True
if the user is online and available, False
if the user is not online or away.
Sends an invitation to a user to chat.
Arguments:
your_app_id@appspot.com
or match the pattern anything@your_app_id.appspotchat.com
. If None
, defaults to your_app_id@appspot.com
.Sends a message to a user.
Arguments:
your_app_id@appspot.com
or match the pattern anything@your_app_id.appspotchat.com
. If None
, defaults to your_app_id@appspot.com
.The type of the message, one of the types allowed by RFC 3921. The allowed values are defined by the following constants:
xmpp.MESSAGE_TYPE_CHAT
: a one-to-one chat messagexmpp.MESSAGE_TYPE_ERROR
: an error message, in response to an incoming messagexmpp.MESSAGE_TYPE_GROUPCHAT
: a group chat messagexmpp.MESSAGE_TYPE_HEADLINE
: an announcement messagexmpp.MESSAGE_TYPE_NORMAL
: a message expecting a reply, but is not a one-to-one chat or group chat messageNote: An app can only receive messages of the "chat" and "normal" types. In particular, this means that apps cannot participate in group chats. An app can otherwise send messages of any of the supported types.
True
, the body is expected to be valid XML that is included verbatim in the XMPP message stanza. If False
, the body is treated as plain text (XML characters are escaped before being inserted into the XMPP message).Returns a list of status values, one for each intended recipient in jids. Each status value is one of the following:
xmpp.NO_ERROR
: the message was sent successfully to this userxmpp.INVALID_JID
: this XMPP address was invalidxmpp.OTHER_ERROR
: another error occurred while sending the message to this userpresence_type
is PRESENCE_TYPE_PROBE
, requests presence information from the given user.<appid>@appspot.com
. This is supported as a value. Custom JIDs can be of the form <anything>@<appid>.appspotchat.com
.type
attribute. For convenience, all of the valid types are in the PRESENCE_TYPE_*
constants list in the google.appengine.api.xmpp
package. The default is PRESENCE_TYPE_AVAILABLE
. Any other values throw an exception.PRESENCE_TYPE_PROBE
, this method requests presence information from the specified XMPP address. Presence information will be sent via POST to /_ah/xmpp/presence/available
or /_ah/xmpp/presence/unavailable
as appropriate. See the overview of user presence for more information.
PRESENCE_SHOW_*
constants in the google.api.xmpp package. The default is PRESENCE_SHOW_NONE
. Any other values throw an exception.