Home | History | Annotate | Download | only in xmpp
      1 /*
      2  * libjingle
      3  * Copyright 2004--2005, Google Inc.
      4  *
      5  * Redistribution and use in source and binary forms, with or without
      6  * modification, are permitted provided that the following conditions are met:
      7  *
      8  *  1. Redistributions of source code must retain the above copyright notice,
      9  *     this list of conditions and the following disclaimer.
     10  *  2. Redistributions in binary form must reproduce the above copyright notice,
     11  *     this list of conditions and the following disclaimer in the documentation
     12  *     and/or other materials provided with the distribution.
     13  *  3. The name of the author may not be used to endorse or promote products
     14  *     derived from this software without specific prior written permission.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
     17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
     18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
     19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
     25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26  */
     27 
     28 #include "talk/xmpp/constants.h"
     29 
     30 #include <string>
     31 
     32 #include "talk/base/basicdefs.h"
     33 #include "talk/xmllite/xmlconstants.h"
     34 #include "talk/xmllite/xmlelement.h"
     35 #include "talk/xmllite/qname.h"
     36 #include "talk/xmpp/jid.h"
     37 
     38 namespace buzz {
     39 
     40 // TODO: Remove static objects of complex types, particularly
     41 // Jid and QName.
     42 
     43 const char NS_CLIENT[] = "jabber:client";
     44 const char NS_SERVER[] = "jabber:server";
     45 const char NS_STREAM[] = "http://etherx.jabber.org/streams";
     46 const char NS_XSTREAM[] = "urn:ietf:params:xml:ns:xmpp-streams";
     47 const char NS_TLS[] = "urn:ietf:params:xml:ns:xmpp-tls";
     48 const char NS_SASL[] = "urn:ietf:params:xml:ns:xmpp-sasl";
     49 const char NS_BIND[] = "urn:ietf:params:xml:ns:xmpp-bind";
     50 const char NS_DIALBACK[] = "jabber:server:dialback";
     51 const char NS_SESSION[] = "urn:ietf:params:xml:ns:xmpp-session";
     52 const char NS_STANZA[] = "urn:ietf:params:xml:ns:xmpp-stanzas";
     53 const char NS_PRIVACY[] = "jabber:iq:privacy";
     54 const char NS_ROSTER[] = "jabber:iq:roster";
     55 const char NS_VCARD[] = "vcard-temp";
     56 const char NS_AVATAR_HASH[] = "google:avatar";
     57 const char NS_VCARD_UPDATE[] = "vcard-temp:x:update";
     58 const char STR_CLIENT[] = "client";
     59 const char STR_SERVER[] = "server";
     60 const char STR_STREAM[] = "stream";
     61 
     62 const char STR_GET[] = "get";
     63 const char STR_SET[] = "set";
     64 const char STR_RESULT[] = "result";
     65 const char STR_ERROR[] = "error";
     66 
     67 const char STR_FORM[] = "form";
     68 const char STR_SUBMIT[] = "submit";
     69 const char STR_TEXT_SINGLE[] = "text-single";
     70 const char STR_LIST_SINGLE[] = "list-single";
     71 const char STR_LIST_MULTI[] = "list-multi";
     72 const char STR_HIDDEN[] = "hidden";
     73 const char STR_FORM_TYPE[] = "FORM_TYPE";
     74 
     75 const char STR_FROM[] = "from";
     76 const char STR_TO[] = "to";
     77 const char STR_BOTH[] = "both";
     78 const char STR_REMOVE[] = "remove";
     79 const char STR_TRUE[] = "true";
     80 
     81 const char STR_TYPE[] = "type";
     82 const char STR_NAME[] = "name";
     83 const char STR_ID[] = "id";
     84 const char STR_JID[] = "jid";
     85 const char STR_SUBSCRIPTION[] = "subscription";
     86 const char STR_ASK[] = "ask";
     87 const char STR_X[] = "x";
     88 const char STR_GOOGLE_COM[] = "google.com";
     89 const char STR_GMAIL_COM[] = "gmail.com";
     90 const char STR_GOOGLEMAIL_COM[] = "googlemail.com";
     91 const char STR_DEFAULT_DOMAIN[] = "default.talk.google.com";
     92 const char STR_TALK_GOOGLE_COM[] = "talk.google.com";
     93 const char STR_TALKX_L_GOOGLE_COM[] = "talkx.l.google.com";
     94 const char STR_XMPP_GOOGLE_COM[] = "xmpp.google.com";
     95 const char STR_XMPPX_L_GOOGLE_COM[] = "xmppx.l.google.com";
     96 
     97 #ifdef FEATURE_ENABLE_VOICEMAIL
     98 const char STR_VOICEMAIL[] = "voicemail";
     99 const char STR_OUTGOINGVOICEMAIL[] = "outgoingvoicemail";
    100 #endif
    101 
    102 const char STR_UNAVAILABLE[] = "unavailable";
    103 
    104 const char NS_PING[] = "urn:xmpp:ping";
    105 const StaticQName QN_PING = { NS_PING, "ping" };
    106 
    107 const char NS_MUC_UNIQUE[] = "http://jabber.org/protocol/muc#unique";
    108 const StaticQName QN_MUC_UNIQUE_QUERY = { NS_MUC_UNIQUE, "unique" };
    109 const StaticQName QN_HANGOUT_ID = { STR_EMPTY, "hangout-id" };
    110 
    111 const char STR_GOOGLE_MUC_LOOKUP_JID[] = "lookup.groupchat.google.com";
    112 
    113 const char STR_MUC_ROOMCONFIG_ROOMNAME[] = "muc#roomconfig_roomname";
    114 const char STR_MUC_ROOMCONFIG_FEATURES[] = "muc#roomconfig_features";
    115 const char STR_MUC_ROOM_FEATURE_ENTERPRISE[] = "muc_enterprise";
    116 const char STR_MUC_ROOMCONFIG[] = "http://jabber.org/protocol/muc#roomconfig";
    117 const char STR_MUC_ROOM_FEATURE_HANGOUT[] = "muc_es";
    118 const char STR_MUC_ROOM_FEATURE_HANGOUT_LITE[] = "muc_lite";
    119 const char STR_MUC_ROOM_FEATURE_BROADCAST[] = "broadcast";
    120 const char STR_MUC_ROOM_FEATURE_MULTI_USER_VC[] = "muc_muvc";
    121 
    122 const char STR_ID_TYPE_CONVERSATION[] = "conversation";
    123 const char NS_GOOGLE_MUC_HANGOUT[] = "google:muc#hangout";
    124 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITE =
    125     { NS_GOOGLE_MUC_HANGOUT, "invite" };
    126 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITE_TYPE =
    127     { NS_GOOGLE_MUC_HANGOUT, "invite-type" };
    128 const StaticQName QN_ATTR_CREATE_ACTIVITY =
    129     { STR_EMPTY, "create-activity" };
    130 const StaticQName QN_GOOGLE_MUC_HANGOUT_PUBLIC =
    131     { NS_GOOGLE_MUC_HANGOUT, "public" };
    132 const StaticQName QN_GOOGLE_MUC_HANGOUT_INVITEE =
    133     { NS_GOOGLE_MUC_HANGOUT, "invitee" };
    134 const StaticQName QN_GOOGLE_MUC_HANGOUT_NOTIFICATION_STATUS =
    135     { NS_GOOGLE_MUC_HANGOUT, "notification-status" };
    136 const StaticQName QN_GOOGLE_MUC_HANGOUT_NOTIFICATION_TYPE = {
    137     NS_GOOGLE_MUC_HANGOUT, "notification-type" };
    138 const StaticQName QN_GOOGLE_MUC_HANGOUT_HANGOUT_START_CONTEXT = {
    139     NS_GOOGLE_MUC_HANGOUT, "hangout-start-context" };
    140 const StaticQName QN_GOOGLE_MUC_HANGOUT_CONVERSATION_ID = {
    141     NS_GOOGLE_MUC_HANGOUT, "conversation-id" };
    142 
    143 const StaticQName QN_STREAM_STREAM = { NS_STREAM, STR_STREAM };
    144 const StaticQName QN_STREAM_FEATURES = { NS_STREAM, "features" };
    145 const StaticQName QN_STREAM_ERROR = { NS_STREAM, "error" };
    146 
    147 const StaticQName QN_XSTREAM_BAD_FORMAT = { NS_XSTREAM, "bad-format" };
    148 const StaticQName QN_XSTREAM_BAD_NAMESPACE_PREFIX =
    149     { NS_XSTREAM, "bad-namespace-prefix" };
    150 const StaticQName QN_XSTREAM_CONFLICT = { NS_XSTREAM, "conflict" };
    151 const StaticQName QN_XSTREAM_CONNECTION_TIMEOUT =
    152     { NS_XSTREAM, "connection-timeout" };
    153 const StaticQName QN_XSTREAM_HOST_GONE = { NS_XSTREAM, "host-gone" };
    154 const StaticQName QN_XSTREAM_HOST_UNKNOWN = { NS_XSTREAM, "host-unknown" };
    155 const StaticQName QN_XSTREAM_IMPROPER_ADDRESSIING =
    156      { NS_XSTREAM, "improper-addressing" };
    157 const StaticQName QN_XSTREAM_INTERNAL_SERVER_ERROR =
    158     { NS_XSTREAM, "internal-server-error" };
    159 const StaticQName QN_XSTREAM_INVALID_FROM = { NS_XSTREAM, "invalid-from" };
    160 const StaticQName QN_XSTREAM_INVALID_ID = { NS_XSTREAM, "invalid-id" };
    161 const StaticQName QN_XSTREAM_INVALID_NAMESPACE =
    162     { NS_XSTREAM, "invalid-namespace" };
    163 const StaticQName QN_XSTREAM_INVALID_XML = { NS_XSTREAM, "invalid-xml" };
    164 const StaticQName QN_XSTREAM_NOT_AUTHORIZED = { NS_XSTREAM, "not-authorized" };
    165 const StaticQName QN_XSTREAM_POLICY_VIOLATION =
    166     { NS_XSTREAM, "policy-violation" };
    167 const StaticQName QN_XSTREAM_REMOTE_CONNECTION_FAILED =
    168     { NS_XSTREAM, "remote-connection-failed" };
    169 const StaticQName QN_XSTREAM_RESOURCE_CONSTRAINT =
    170     { NS_XSTREAM, "resource-constraint" };
    171 const StaticQName QN_XSTREAM_RESTRICTED_XML = { NS_XSTREAM, "restricted-xml" };
    172 const StaticQName QN_XSTREAM_SEE_OTHER_HOST = { NS_XSTREAM, "see-other-host" };
    173 const StaticQName QN_XSTREAM_SYSTEM_SHUTDOWN =
    174     { NS_XSTREAM, "system-shutdown" };
    175 const StaticQName QN_XSTREAM_UNDEFINED_CONDITION =
    176     { NS_XSTREAM, "undefined-condition" };
    177 const StaticQName QN_XSTREAM_UNSUPPORTED_ENCODING =
    178     { NS_XSTREAM, "unsupported-encoding" };
    179 const StaticQName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE =
    180     { NS_XSTREAM, "unsupported-stanza-type" };
    181 const StaticQName QN_XSTREAM_UNSUPPORTED_VERSION =
    182     { NS_XSTREAM, "unsupported-version" };
    183 const StaticQName QN_XSTREAM_XML_NOT_WELL_FORMED =
    184     { NS_XSTREAM, "xml-not-well-formed" };
    185 const StaticQName QN_XSTREAM_TEXT = { NS_XSTREAM, "text" };
    186 
    187 const StaticQName QN_TLS_STARTTLS = { NS_TLS, "starttls" };
    188 const StaticQName QN_TLS_REQUIRED = { NS_TLS, "required" };
    189 const StaticQName QN_TLS_PROCEED = { NS_TLS, "proceed" };
    190 const StaticQName QN_TLS_FAILURE = { NS_TLS, "failure" };
    191 
    192 const StaticQName QN_SASL_MECHANISMS = { NS_SASL, "mechanisms" };
    193 const StaticQName QN_SASL_MECHANISM = { NS_SASL, "mechanism" };
    194 const StaticQName QN_SASL_AUTH = { NS_SASL, "auth" };
    195 const StaticQName QN_SASL_CHALLENGE = { NS_SASL, "challenge" };
    196 const StaticQName QN_SASL_RESPONSE = { NS_SASL, "response" };
    197 const StaticQName QN_SASL_ABORT = { NS_SASL, "abort" };
    198 const StaticQName QN_SASL_SUCCESS = { NS_SASL, "success" };
    199 const StaticQName QN_SASL_FAILURE = { NS_SASL, "failure" };
    200 const StaticQName QN_SASL_ABORTED = { NS_SASL, "aborted" };
    201 const StaticQName QN_SASL_INCORRECT_ENCODING =
    202     { NS_SASL, "incorrect-encoding" };
    203 const StaticQName QN_SASL_INVALID_AUTHZID = { NS_SASL, "invalid-authzid" };
    204 const StaticQName QN_SASL_INVALID_MECHANISM = { NS_SASL, "invalid-mechanism" };
    205 const StaticQName QN_SASL_MECHANISM_TOO_WEAK =
    206     { NS_SASL, "mechanism-too-weak" };
    207 const StaticQName QN_SASL_NOT_AUTHORIZED = { NS_SASL, "not-authorized" };
    208 const StaticQName QN_SASL_TEMPORARY_AUTH_FAILURE =
    209     { NS_SASL, "temporary-auth-failure" };
    210 
    211 // These are non-standard.
    212 const char NS_GOOGLE_AUTH_PROTOCOL[] =
    213     "http://www.google.com/talk/protocol/auth";
    214 const StaticQName QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT =
    215     { NS_GOOGLE_AUTH_PROTOCOL, "client-uses-full-bind-result" };
    216 const char NS_GOOGLE_AUTH_OLD[] = "google:auth";
    217 const StaticQName QN_GOOGLE_ALLOW_NON_GOOGLE_ID_XMPP_LOGIN =
    218     { NS_GOOGLE_AUTH_PROTOCOL, "allow-non-google-login" };
    219 const StaticQName QN_GOOGLE_AUTH_SERVICE =
    220     { NS_GOOGLE_AUTH_PROTOCOL, "service" };
    221 
    222 const StaticQName QN_DIALBACK_RESULT = { NS_DIALBACK, "result" };
    223 const StaticQName QN_DIALBACK_VERIFY = { NS_DIALBACK, "verify" };
    224 
    225 const StaticQName QN_STANZA_BAD_REQUEST = { NS_STANZA, "bad-request" };
    226 const StaticQName QN_STANZA_CONFLICT = { NS_STANZA, "conflict" };
    227 const StaticQName QN_STANZA_FEATURE_NOT_IMPLEMENTED =
    228     { NS_STANZA, "feature-not-implemented" };
    229 const StaticQName QN_STANZA_FORBIDDEN = { NS_STANZA, "forbidden" };
    230 const StaticQName QN_STANZA_GONE = { NS_STANZA, "gone" };
    231 const StaticQName QN_STANZA_INTERNAL_SERVER_ERROR =
    232     { NS_STANZA, "internal-server-error" };
    233 const StaticQName QN_STANZA_ITEM_NOT_FOUND = { NS_STANZA, "item-not-found" };
    234 const StaticQName QN_STANZA_JID_MALFORMED = { NS_STANZA, "jid-malformed" };
    235 const StaticQName QN_STANZA_NOT_ACCEPTABLE = { NS_STANZA, "not-acceptable" };
    236 const StaticQName QN_STANZA_NOT_ALLOWED = { NS_STANZA, "not-allowed" };
    237 const StaticQName QN_STANZA_PAYMENT_REQUIRED =
    238     { NS_STANZA, "payment-required" };
    239 const StaticQName QN_STANZA_RECIPIENT_UNAVAILABLE =
    240     { NS_STANZA, "recipient-unavailable" };
    241 const StaticQName QN_STANZA_REDIRECT = { NS_STANZA, "redirect" };
    242 const StaticQName QN_STANZA_REGISTRATION_REQUIRED =
    243     { NS_STANZA, "registration-required" };
    244 const StaticQName QN_STANZA_REMOTE_SERVER_NOT_FOUND =
    245     { NS_STANZA, "remote-server-not-found" };
    246 const StaticQName QN_STANZA_REMOTE_SERVER_TIMEOUT =
    247     { NS_STANZA, "remote-server-timeout" };
    248 const StaticQName QN_STANZA_RESOURCE_CONSTRAINT =
    249     { NS_STANZA, "resource-constraint" };
    250 const StaticQName QN_STANZA_SERVICE_UNAVAILABLE =
    251     { NS_STANZA, "service-unavailable" };
    252 const StaticQName QN_STANZA_SUBSCRIPTION_REQUIRED =
    253     { NS_STANZA, "subscription-required" };
    254 const StaticQName QN_STANZA_UNDEFINED_CONDITION =
    255     { NS_STANZA, "undefined-condition" };
    256 const StaticQName QN_STANZA_UNEXPECTED_REQUEST =
    257     { NS_STANZA, "unexpected-request" };
    258 const StaticQName QN_STANZA_TEXT = { NS_STANZA, "text" };
    259 
    260 const StaticQName QN_BIND_BIND = { NS_BIND, "bind" };
    261 const StaticQName QN_BIND_RESOURCE = { NS_BIND, "resource" };
    262 const StaticQName QN_BIND_JID = { NS_BIND, "jid" };
    263 
    264 const StaticQName QN_MESSAGE = { NS_CLIENT, "message" };
    265 const StaticQName QN_BODY = { NS_CLIENT, "body" };
    266 const StaticQName QN_SUBJECT = { NS_CLIENT, "subject" };
    267 const StaticQName QN_THREAD = { NS_CLIENT, "thread" };
    268 const StaticQName QN_PRESENCE = { NS_CLIENT, "presence" };
    269 const StaticQName QN_SHOW = { NS_CLIENT, "show" };
    270 const StaticQName QN_STATUS = { NS_CLIENT, "status" };
    271 const StaticQName QN_LANG = { NS_CLIENT, "lang" };
    272 const StaticQName QN_PRIORITY = { NS_CLIENT, "priority" };
    273 const StaticQName QN_IQ = { NS_CLIENT, "iq" };
    274 const StaticQName QN_ERROR = { NS_CLIENT, "error" };
    275 
    276 const StaticQName QN_SERVER_MESSAGE = { NS_SERVER, "message" };
    277 const StaticQName QN_SERVER_BODY = { NS_SERVER, "body" };
    278 const StaticQName QN_SERVER_SUBJECT = { NS_SERVER, "subject" };
    279 const StaticQName QN_SERVER_THREAD = { NS_SERVER, "thread" };
    280 const StaticQName QN_SERVER_PRESENCE = { NS_SERVER, "presence" };
    281 const StaticQName QN_SERVER_SHOW = { NS_SERVER, "show" };
    282 const StaticQName QN_SERVER_STATUS = { NS_SERVER, "status" };
    283 const StaticQName QN_SERVER_LANG = { NS_SERVER, "lang" };
    284 const StaticQName QN_SERVER_PRIORITY = { NS_SERVER, "priority" };
    285 const StaticQName QN_SERVER_IQ = { NS_SERVER, "iq" };
    286 const StaticQName QN_SERVER_ERROR = { NS_SERVER, "error" };
    287 
    288 const StaticQName QN_SESSION_SESSION = { NS_SESSION, "session" };
    289 
    290 const StaticQName QN_PRIVACY_QUERY = { NS_PRIVACY, "query" };
    291 const StaticQName QN_PRIVACY_ACTIVE = { NS_PRIVACY, "active" };
    292 const StaticQName QN_PRIVACY_DEFAULT = { NS_PRIVACY, "default" };
    293 const StaticQName QN_PRIVACY_LIST = { NS_PRIVACY, "list" };
    294 const StaticQName QN_PRIVACY_ITEM = { NS_PRIVACY, "item" };
    295 const StaticQName QN_PRIVACY_IQ = { NS_PRIVACY, "iq" };
    296 const StaticQName QN_PRIVACY_MESSAGE = { NS_PRIVACY, "message" };
    297 const StaticQName QN_PRIVACY_PRESENCE_IN = { NS_PRIVACY, "presence-in" };
    298 const StaticQName QN_PRIVACY_PRESENCE_OUT = { NS_PRIVACY, "presence-out" };
    299 
    300 const StaticQName QN_ROSTER_QUERY = { NS_ROSTER, "query" };
    301 const StaticQName QN_ROSTER_ITEM = { NS_ROSTER, "item" };
    302 const StaticQName QN_ROSTER_GROUP = { NS_ROSTER, "group" };
    303 
    304 const StaticQName QN_VCARD = { NS_VCARD, "vCard" };
    305 const StaticQName QN_VCARD_FN = { NS_VCARD, "FN" };
    306 const StaticQName QN_VCARD_PHOTO = { NS_VCARD, "PHOTO" };
    307 const StaticQName QN_VCARD_PHOTO_BINVAL = { NS_VCARD, "BINVAL" };
    308 const StaticQName QN_VCARD_AVATAR_HASH = { NS_AVATAR_HASH, "hash" };
    309 const StaticQName QN_VCARD_AVATAR_HASH_MODIFIED =
    310     { NS_AVATAR_HASH, "modified" };
    311 
    312 const StaticQName QN_NAME = { STR_EMPTY, "name" };
    313 const StaticQName QN_AFFILIATION = { STR_EMPTY, "affiliation" };
    314 const StaticQName QN_ROLE = { STR_EMPTY, "role" };
    315 
    316 #if defined(FEATURE_ENABLE_PSTN)
    317 const StaticQName QN_VCARD_TEL = { NS_VCARD, "TEL" };
    318 const StaticQName QN_VCARD_VOICE = { NS_VCARD, "VOICE" };
    319 const StaticQName QN_VCARD_HOME = { NS_VCARD, "HOME" };
    320 const StaticQName QN_VCARD_WORK = { NS_VCARD, "WORK" };
    321 const StaticQName QN_VCARD_CELL = { NS_VCARD, "CELL" };
    322 const StaticQName QN_VCARD_NUMBER = { NS_VCARD, "NUMBER" };
    323 #endif
    324 
    325 const StaticQName QN_XML_LANG = { NS_XML, "lang" };
    326 
    327 const StaticQName QN_ENCODING = { STR_EMPTY, STR_ENCODING };
    328 const StaticQName QN_VERSION = { STR_EMPTY, STR_VERSION };
    329 const StaticQName QN_TO = { STR_EMPTY, "to" };
    330 const StaticQName QN_FROM = { STR_EMPTY, "from" };
    331 const StaticQName QN_TYPE = { STR_EMPTY, "type" };
    332 const StaticQName QN_ID = { STR_EMPTY, "id" };
    333 const StaticQName QN_CODE = { STR_EMPTY, "code" };
    334 
    335 const StaticQName QN_VALUE = { STR_EMPTY, "value" };
    336 const StaticQName QN_ACTION = { STR_EMPTY, "action" };
    337 const StaticQName QN_ORDER = { STR_EMPTY, "order" };
    338 const StaticQName QN_MECHANISM = { STR_EMPTY, "mechanism" };
    339 const StaticQName QN_ASK = { STR_EMPTY, "ask" };
    340 const StaticQName QN_JID = { STR_EMPTY, "jid" };
    341 const StaticQName QN_NICK = { STR_EMPTY, "nick" };
    342 const StaticQName QN_SUBSCRIPTION = { STR_EMPTY, "subscription" };
    343 const StaticQName QN_TITLE1 = { STR_EMPTY, "title1" };
    344 const StaticQName QN_TITLE2 = { STR_EMPTY, "title2" };
    345 const StaticQName QN_SOURCE = { STR_EMPTY, "source" };
    346 const StaticQName QN_TIME = { STR_EMPTY, "time" };
    347 
    348 const StaticQName QN_XMLNS_CLIENT = { NS_XMLNS, STR_CLIENT };
    349 const StaticQName QN_XMLNS_SERVER = { NS_XMLNS, STR_SERVER };
    350 const StaticQName QN_XMLNS_STREAM = { NS_XMLNS, STR_STREAM };
    351 
    352 
    353 // Presence
    354 const char STR_SHOW_AWAY[] = "away";
    355 const char STR_SHOW_CHAT[] = "chat";
    356 const char STR_SHOW_DND[] = "dnd";
    357 const char STR_SHOW_XA[] = "xa";
    358 const char STR_SHOW_OFFLINE[] = "offline";
    359 
    360 const char NS_GOOGLE_PSTN_CONFERENCE[] = "http://www.google.com/pstn-conference";
    361 const StaticQName QN_GOOGLE_PSTN_CONFERENCE_STATUS = { NS_GOOGLE_PSTN_CONFERENCE, "status" };
    362 const StaticQName QN_ATTR_STATUS = { STR_EMPTY, "status" };
    363 
    364 // Presence connection status
    365 const char STR_PSTN_CONFERENCE_STATUS_CONNECTING[] = "connecting";
    366 const char STR_PSTN_CONFERENCE_STATUS_JOINING[] = "joining";
    367 const char STR_PSTN_CONFERENCE_STATUS_CONNECTED[] = "connected";
    368 const char STR_PSTN_CONFERENCE_STATUS_HANGUP[] = "hangup";
    369 
    370 // Subscription
    371 const char STR_SUBSCRIBE[] = "subscribe";
    372 const char STR_SUBSCRIBED[] = "subscribed";
    373 const char STR_UNSUBSCRIBE[] = "unsubscribe";
    374 const char STR_UNSUBSCRIBED[] = "unsubscribed";
    375 
    376 // Google Invite
    377 const char NS_GOOGLE_SUBSCRIBE[] = "google:subscribe";
    378 const StaticQName QN_INVITATION = { NS_GOOGLE_SUBSCRIBE, "invitation" };
    379 const StaticQName QN_INVITE_NAME = { NS_GOOGLE_SUBSCRIBE, "name" };
    380 const StaticQName QN_INVITE_SUBJECT = { NS_GOOGLE_SUBSCRIBE, "subject" };
    381 const StaticQName QN_INVITE_MESSAGE = { NS_GOOGLE_SUBSCRIBE, "body" };
    382 
    383 // Kick
    384 const char NS_GOOGLE_MUC_ADMIN[] = "google:muc#admin";
    385 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY = { NS_GOOGLE_MUC_ADMIN, "query" };
    386 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY_ITEM =
    387     { NS_GOOGLE_MUC_ADMIN, "item" };
    388 const StaticQName QN_GOOGLE_MUC_ADMIN_QUERY_ITEM_REASON =
    389     { NS_GOOGLE_MUC_ADMIN, "reason" };
    390 
    391 // PubSub: http://xmpp.org/extensions/xep-0060.html
    392 const char NS_PUBSUB[] = "http://jabber.org/protocol/pubsub";
    393 const StaticQName QN_PUBSUB = { NS_PUBSUB, "pubsub" };
    394 const StaticQName QN_PUBSUB_ITEMS = { NS_PUBSUB, "items" };
    395 const StaticQName QN_PUBSUB_ITEM = { NS_PUBSUB, "item" };
    396 const StaticQName QN_PUBSUB_PUBLISH = { NS_PUBSUB, "publish" };
    397 const StaticQName QN_PUBSUB_RETRACT = { NS_PUBSUB, "retract" };
    398 const StaticQName QN_ATTR_PUBLISHER = { STR_EMPTY, "publisher" };
    399 
    400 const char NS_PUBSUB_EVENT[] = "http://jabber.org/protocol/pubsub#event";
    401 const StaticQName QN_NODE = { STR_EMPTY, "node" };
    402 const StaticQName QN_PUBSUB_EVENT = { NS_PUBSUB_EVENT, "event" };
    403 const StaticQName QN_PUBSUB_EVENT_ITEMS = { NS_PUBSUB_EVENT, "items" };
    404 const StaticQName QN_PUBSUB_EVENT_ITEM = { NS_PUBSUB_EVENT, "item" };
    405 const StaticQName QN_PUBSUB_EVENT_RETRACT = { NS_PUBSUB_EVENT, "retract" };
    406 const StaticQName QN_NOTIFY = { STR_EMPTY, "notify" };
    407 
    408 const char NS_PRESENTER[] = "google:presenter";
    409 const StaticQName QN_PRESENTER_PRESENTER = { NS_PRESENTER, "presenter" };
    410 const StaticQName QN_PRESENTER_PRESENTATION_ITEM =
    411     { NS_PRESENTER, "presentation-item" };
    412 const StaticQName QN_PRESENTER_PRESENTATION_TYPE =
    413     { NS_PRESENTER, "presentation-type" };
    414 const StaticQName QN_PRESENTER_PRESENTATION_ID =
    415     { NS_PRESENTER, "presentation-id" };
    416 
    417 // JEP 0030
    418 const StaticQName QN_CATEGORY = { STR_EMPTY, "category" };
    419 const StaticQName QN_VAR = { STR_EMPTY, "var" };
    420 const char NS_DISCO_INFO[] = "http://jabber.org/protocol/disco#info";
    421 const char NS_DISCO_ITEMS[] = "http://jabber.org/protocol/disco#items";
    422 const StaticQName QN_DISCO_INFO_QUERY = { NS_DISCO_INFO, "query" };
    423 const StaticQName QN_DISCO_IDENTITY = { NS_DISCO_INFO, "identity" };
    424 const StaticQName QN_DISCO_FEATURE = { NS_DISCO_INFO, "feature" };
    425 
    426 const StaticQName QN_DISCO_ITEMS_QUERY = { NS_DISCO_ITEMS, "query" };
    427 const StaticQName QN_DISCO_ITEM = { NS_DISCO_ITEMS, "item" };
    428 
    429 // JEP 0020
    430 const char NS_FEATURE[] = "http://jabber.org/protocol/feature-neg";
    431 const StaticQName QN_FEATURE_FEATURE = { NS_FEATURE, "feature" };
    432 
    433 // JEP 0004
    434 const char NS_XDATA[] = "jabber:x:data";
    435 const StaticQName QN_XDATA_X = { NS_XDATA, "x" };
    436 const StaticQName QN_XDATA_INSTRUCTIONS = { NS_XDATA, "instructions" };
    437 const StaticQName QN_XDATA_TITLE = { NS_XDATA, "title" };
    438 const StaticQName QN_XDATA_FIELD = { NS_XDATA, "field" };
    439 const StaticQName QN_XDATA_REPORTED = { NS_XDATA, "reported" };
    440 const StaticQName QN_XDATA_ITEM = { NS_XDATA, "item" };
    441 const StaticQName QN_XDATA_DESC = { NS_XDATA, "desc" };
    442 const StaticQName QN_XDATA_REQUIRED = { NS_XDATA, "required" };
    443 const StaticQName QN_XDATA_VALUE = { NS_XDATA, "value" };
    444 const StaticQName QN_XDATA_OPTION = { NS_XDATA, "option" };
    445 
    446 // JEP 0045
    447 const char NS_MUC[] = "http://jabber.org/protocol/muc";
    448 const StaticQName QN_MUC_X = { NS_MUC, "x" };
    449 const StaticQName QN_MUC_ITEM = { NS_MUC, "item" };
    450 const StaticQName QN_MUC_AFFILIATION = { NS_MUC, "affiliation" };
    451 const StaticQName QN_MUC_ROLE = { NS_MUC, "role" };
    452 const char STR_AFFILIATION_NONE[] = "none";
    453 const char STR_ROLE_PARTICIPANT[] = "participant";
    454 
    455 const char NS_GOOGLE_SESSION[] = "http://www.google.com/session";
    456 const StaticQName QN_GOOGLE_CIRCLE_ID = { STR_EMPTY, "google-circle-id" };
    457 const StaticQName QN_GOOGLE_USER_ID = { STR_EMPTY, "google-user-id" };
    458 const StaticQName QN_GOOGLE_SESSION_BLOCKED = { NS_GOOGLE_SESSION, "blocked" };
    459 const StaticQName QN_GOOGLE_SESSION_BLOCKING =
    460     { NS_GOOGLE_SESSION, "blocking" };
    461 
    462 const char NS_MUC_OWNER[] = "http://jabber.org/protocol/muc#owner";
    463 const StaticQName QN_MUC_OWNER_QUERY = { NS_MUC_OWNER, "query" };
    464 
    465 const char NS_MUC_USER[] = "http://jabber.org/protocol/muc#user";
    466 const StaticQName QN_MUC_USER_CONTINUE = { NS_MUC_USER, "continue" };
    467 const StaticQName QN_MUC_USER_X = { NS_MUC_USER, "x" };
    468 const StaticQName QN_MUC_USER_ITEM = { NS_MUC_USER, "item" };
    469 const StaticQName QN_MUC_USER_STATUS = { NS_MUC_USER, "status" };
    470 const StaticQName QN_MUC_USER_REASON = { NS_MUC_USER, "reason" };
    471 const StaticQName QN_MUC_USER_ABUSE_VIOLATION = { NS_MUC_USER, "abuse-violation" };
    472 
    473 // JEP 0055 - Jabber Search
    474 const char NS_SEARCH[] = "jabber:iq:search";
    475 const StaticQName QN_SEARCH_QUERY = { NS_SEARCH, "query" };
    476 const StaticQName QN_SEARCH_ITEM = { NS_SEARCH, "item" };
    477 const StaticQName QN_SEARCH_ROOM_NAME = { NS_SEARCH, "room-name" };
    478 const StaticQName QN_SEARCH_ROOM_DOMAIN = { NS_SEARCH, "room-domain" };
    479 const StaticQName QN_SEARCH_ROOM_JID = { NS_SEARCH, "room-jid" };
    480 const StaticQName QN_SEARCH_HANGOUT_ID = { NS_SEARCH, "hangout-id" };
    481 const StaticQName QN_SEARCH_EXTERNAL_ID = { NS_SEARCH, "external-id" };
    482 
    483 // JEP 0115
    484 const char NS_CAPS[] = "http://jabber.org/protocol/caps";
    485 const StaticQName QN_CAPS_C = { NS_CAPS, "c" };
    486 const StaticQName QN_VER = { STR_EMPTY, "ver" };
    487 const StaticQName QN_EXT = { STR_EMPTY, "ext" };
    488 
    489 // JEP 0153
    490 const char kNSVCard[] = "vcard-temp:x:update";
    491 const StaticQName kQnVCardX = { kNSVCard, "x" };
    492 const StaticQName kQnVCardPhoto = { kNSVCard, "photo" };
    493 
    494 // JEP 0172 User Nickname
    495 const char NS_NICKNAME[] = "http://jabber.org/protocol/nick";
    496 const StaticQName QN_NICKNAME = { NS_NICKNAME, "nick" };
    497 
    498 // JEP 0085 chat state
    499 const char NS_CHATSTATE[] = "http://jabber.org/protocol/chatstates";
    500 const StaticQName QN_CS_ACTIVE = { NS_CHATSTATE, "active" };
    501 const StaticQName QN_CS_COMPOSING = { NS_CHATSTATE, "composing" };
    502 const StaticQName QN_CS_PAUSED = { NS_CHATSTATE, "paused" };
    503 const StaticQName QN_CS_INACTIVE = { NS_CHATSTATE, "inactive" };
    504 const StaticQName QN_CS_GONE = { NS_CHATSTATE, "gone" };
    505 
    506 // JEP 0091 Delayed Delivery
    507 const char kNSDelay[] = "jabber:x:delay";
    508 const StaticQName kQnDelayX = { kNSDelay, "x" };
    509 const StaticQName kQnStamp = { STR_EMPTY, "stamp" };
    510 
    511 // Google time stamping (higher resolution)
    512 const char kNSTimestamp[] = "google:timestamp";
    513 const StaticQName kQnTime = { kNSTimestamp, "time" };
    514 const StaticQName kQnMilliseconds = { STR_EMPTY, "ms" };
    515 
    516 // Jingle Info
    517 const char NS_JINGLE_INFO[] = "google:jingleinfo";
    518 const StaticQName QN_JINGLE_INFO_QUERY = { NS_JINGLE_INFO, "query" };
    519 const StaticQName QN_JINGLE_INFO_STUN = { NS_JINGLE_INFO, "stun" };
    520 const StaticQName QN_JINGLE_INFO_RELAY = { NS_JINGLE_INFO, "relay" };
    521 const StaticQName QN_JINGLE_INFO_SERVER = { NS_JINGLE_INFO, "server" };
    522 const StaticQName QN_JINGLE_INFO_TOKEN = { NS_JINGLE_INFO, "token" };
    523 const StaticQName QN_JINGLE_INFO_HOST = { STR_EMPTY, "host" };
    524 const StaticQName QN_JINGLE_INFO_TCP = { STR_EMPTY, "tcp" };
    525 const StaticQName QN_JINGLE_INFO_UDP = { STR_EMPTY, "udp" };
    526 const StaticQName QN_JINGLE_INFO_TCPSSL = { STR_EMPTY, "tcpssl" };
    527 
    528 // Call Performance Logging
    529 const char NS_GOOGLE_CALLPERF_STATS[] = "google:call-perf-stats";
    530 const StaticQName QN_CALLPERF_STATS =
    531     { NS_GOOGLE_CALLPERF_STATS, "callPerfStats" };
    532 const StaticQName QN_CALLPERF_SESSIONID = { STR_EMPTY, "sessionId" };
    533 const StaticQName QN_CALLPERF_LOCALUSER = { STR_EMPTY, "localUser" };
    534 const StaticQName QN_CALLPERF_REMOTEUSER = { STR_EMPTY, "remoteUser" };
    535 const StaticQName QN_CALLPERF_STARTTIME = { STR_EMPTY, "startTime" };
    536 const StaticQName QN_CALLPERF_CALL_LENGTH = { STR_EMPTY, "callLength" };
    537 const StaticQName QN_CALLPERF_CALL_ACCEPTED = { STR_EMPTY, "callAccepted" };
    538 const StaticQName QN_CALLPERF_CALL_ERROR_CODE = { STR_EMPTY, "callErrorCode" };
    539 const StaticQName QN_CALLPERF_TERMINATE_CODE = { STR_EMPTY, "terminateCode" };
    540 const StaticQName QN_CALLPERF_DATAPOINT =
    541     { NS_GOOGLE_CALLPERF_STATS, "dataPoint" };
    542 const StaticQName QN_CALLPERF_DATAPOINT_TIME = { STR_EMPTY, "timeStamp" };
    543 const StaticQName QN_CALLPERF_DATAPOINT_FRACTION_LOST =
    544     { STR_EMPTY, "fraction_lost" };
    545 const StaticQName QN_CALLPERF_DATAPOINT_CUM_LOST = { STR_EMPTY, "cum_lost" };
    546 const StaticQName QN_CALLPERF_DATAPOINT_EXT_MAX = { STR_EMPTY, "ext_max" };
    547 const StaticQName QN_CALLPERF_DATAPOINT_JITTER = { STR_EMPTY, "jitter" };
    548 const StaticQName QN_CALLPERF_DATAPOINT_RTT = { STR_EMPTY, "RTT" };
    549 const StaticQName QN_CALLPERF_DATAPOINT_BYTES_R =
    550     { STR_EMPTY, "bytesReceived" };
    551 const StaticQName QN_CALLPERF_DATAPOINT_PACKETS_R =
    552     { STR_EMPTY, "packetsReceived" };
    553 const StaticQName QN_CALLPERF_DATAPOINT_BYTES_S = { STR_EMPTY, "bytesSent" };
    554 const StaticQName QN_CALLPERF_DATAPOINT_PACKETS_S =
    555     { STR_EMPTY, "packetsSent" };
    556 const StaticQName QN_CALLPERF_DATAPOINT_PROCESS_CPU =
    557     { STR_EMPTY, "processCpu" };
    558 const StaticQName QN_CALLPERF_DATAPOINT_SYSTEM_CPU = { STR_EMPTY, "systemCpu" };
    559 const StaticQName QN_CALLPERF_DATAPOINT_CPUS = { STR_EMPTY, "cpus" };
    560 const StaticQName QN_CALLPERF_CONNECTION =
    561     { NS_GOOGLE_CALLPERF_STATS, "connection" };
    562 const StaticQName QN_CALLPERF_CONNECTION_LOCAL_ADDRESS =
    563     { STR_EMPTY, "localAddress" };
    564 const StaticQName QN_CALLPERF_CONNECTION_REMOTE_ADDRESS =
    565     { STR_EMPTY, "remoteAddress" };
    566 const StaticQName QN_CALLPERF_CONNECTION_FLAGS = { STR_EMPTY, "flags" };
    567 const StaticQName QN_CALLPERF_CONNECTION_RTT = { STR_EMPTY, "rtt" };
    568 const StaticQName QN_CALLPERF_CONNECTION_TOTAL_BYTES_S =
    569     { STR_EMPTY, "totalBytesSent" };
    570 const StaticQName QN_CALLPERF_CONNECTION_BYTES_SECOND_S =
    571     { STR_EMPTY, "bytesSecondSent" };
    572 const StaticQName QN_CALLPERF_CONNECTION_TOTAL_BYTES_R =
    573     { STR_EMPTY, "totalBytesRecv" };
    574 const StaticQName QN_CALLPERF_CONNECTION_BYTES_SECOND_R =
    575     { STR_EMPTY, "bytesSecondRecv" };
    576 const StaticQName QN_CALLPERF_CANDIDATE =
    577     { NS_GOOGLE_CALLPERF_STATS, "candidate" };
    578 const StaticQName QN_CALLPERF_CANDIDATE_ENDPOINT = { STR_EMPTY, "endpoint" };
    579 const StaticQName QN_CALLPERF_CANDIDATE_PROTOCOL = { STR_EMPTY, "protocol" };
    580 const StaticQName QN_CALLPERF_CANDIDATE_ADDRESS = { STR_EMPTY, "address" };
    581 const StaticQName QN_CALLPERF_MEDIA = { NS_GOOGLE_CALLPERF_STATS, "media" };
    582 const StaticQName QN_CALLPERF_MEDIA_DIRECTION = { STR_EMPTY, "direction" };
    583 const StaticQName QN_CALLPERF_MEDIA_SSRC = { STR_EMPTY, "SSRC" };
    584 const StaticQName QN_CALLPERF_MEDIA_ENERGY = { STR_EMPTY, "energy" };
    585 const StaticQName QN_CALLPERF_MEDIA_FIR = { STR_EMPTY, "fir" };
    586 const StaticQName QN_CALLPERF_MEDIA_NACK = { STR_EMPTY, "nack" };
    587 const StaticQName QN_CALLPERF_MEDIA_FPS = { STR_EMPTY, "fps" };
    588 const StaticQName QN_CALLPERF_MEDIA_FPS_NETWORK = { STR_EMPTY, "fpsNetwork" };
    589 const StaticQName QN_CALLPERF_MEDIA_FPS_DECODED = { STR_EMPTY, "fpsDecoded" };
    590 const StaticQName QN_CALLPERF_MEDIA_JITTER_BUFFER_SIZE =
    591     { STR_EMPTY, "jitterBufferSize" };
    592 const StaticQName QN_CALLPERF_MEDIA_PREFERRED_JITTER_BUFFER_SIZE =
    593     { STR_EMPTY, "preferredJitterBufferSize" };
    594 const StaticQName QN_CALLPERF_MEDIA_TOTAL_PLAYOUT_DELAY =
    595     { STR_EMPTY, "totalPlayoutDelay" };
    596 
    597 // Muc invites.
    598 const StaticQName QN_MUC_USER_INVITE = { NS_MUC_USER, "invite" };
    599 
    600 // Multiway audio/video.
    601 const char NS_GOOGLE_MUC_USER[] = "google:muc#user";
    602 const StaticQName QN_GOOGLE_MUC_USER_AVAILABLE_MEDIA =
    603     { NS_GOOGLE_MUC_USER, "available-media" };
    604 const StaticQName QN_GOOGLE_MUC_USER_ENTRY = { NS_GOOGLE_MUC_USER, "entry" };
    605 const StaticQName QN_GOOGLE_MUC_USER_MEDIA = { NS_GOOGLE_MUC_USER, "media" };
    606 const StaticQName QN_GOOGLE_MUC_USER_TYPE = { NS_GOOGLE_MUC_USER, "type" };
    607 const StaticQName QN_GOOGLE_MUC_USER_SRC_ID = { NS_GOOGLE_MUC_USER, "src-id" };
    608 const StaticQName QN_GOOGLE_MUC_USER_STATUS = { NS_GOOGLE_MUC_USER, "status" };
    609 const StaticQName QN_CLIENT_VERSION = { NS_GOOGLE_MUC_USER, "client-version" };
    610 const StaticQName QN_LOCALE = { NS_GOOGLE_MUC_USER, "locale" };
    611 const StaticQName QN_LABEL = { STR_EMPTY, "label" };
    612 
    613 const char NS_GOOGLE_MUC_MEDIA[] = "google:muc#media";
    614 const StaticQName QN_GOOGLE_MUC_AUDIO_MUTE =
    615     { NS_GOOGLE_MUC_MEDIA, "audio-mute" };
    616 const StaticQName QN_GOOGLE_MUC_VIDEO_MUTE =
    617     { NS_GOOGLE_MUC_MEDIA, "video-mute" };
    618 const StaticQName QN_GOOGLE_MUC_VIDEO_PAUSE =
    619     { NS_GOOGLE_MUC_MEDIA, "video-pause" };
    620 const StaticQName QN_GOOGLE_MUC_RECORDING =
    621     { NS_GOOGLE_MUC_MEDIA, "recording" };
    622 const StaticQName QN_GOOGLE_MUC_MEDIA_BLOCK = { NS_GOOGLE_MUC_MEDIA, "block" };
    623 const StaticQName QN_STATE_ATTR = { STR_EMPTY, "state" };
    624 
    625 const char AUTH_MECHANISM_GOOGLE_COOKIE[] = "X-GOOGLE-COOKIE";
    626 const char AUTH_MECHANISM_GOOGLE_TOKEN[] = "X-GOOGLE-TOKEN";
    627 const char AUTH_MECHANISM_OAUTH2[] = "X-OAUTH2";
    628 const char AUTH_MECHANISM_PLAIN[] = "PLAIN";
    629 
    630 }  // namespace buzz
    631