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 <string>
     29 #include "talk/base/basicdefs.h"
     30 #include "talk/xmllite/xmlconstants.h"
     31 #include "talk/xmllite/xmlelement.h"
     32 #include "talk/xmllite/qname.h"
     33 #include "talk/xmpp/jid.h"
     34 #include "talk/xmpp/constants.h"
     35 namespace buzz {
     36 
     37 const Jid JID_EMPTY(STR_EMPTY);
     38 
     39 const std::string & Constants::ns_client() {
     40   static const std::string ns_client_("jabber:client");
     41   return ns_client_;
     42 }
     43 
     44 const std::string & Constants::ns_server() {
     45   static const std::string ns_server_("jabber:server");
     46   return ns_server_;
     47 }
     48 
     49 const std::string & Constants::ns_stream() {
     50   static const std::string ns_stream_("http://etherx.jabber.org/streams");
     51   return ns_stream_;
     52 }
     53 
     54 const std::string & Constants::ns_xstream() {
     55   static const std::string ns_xstream_("urn:ietf:params:xml:ns:xmpp-streams");
     56   return ns_xstream_;
     57 }
     58 
     59 const std::string & Constants::ns_tls() {
     60   static const std::string ns_tls_("urn:ietf:params:xml:ns:xmpp-tls");
     61   return ns_tls_;
     62 }
     63 
     64 const std::string & Constants::ns_sasl() {
     65   static const std::string ns_sasl_("urn:ietf:params:xml:ns:xmpp-sasl");
     66   return ns_sasl_;
     67 }
     68 
     69 const std::string & Constants::ns_bind() {
     70   static const std::string ns_bind_("urn:ietf:params:xml:ns:xmpp-bind");
     71   return ns_bind_;
     72 }
     73 
     74 const std::string & Constants::ns_dialback() {
     75   static const std::string ns_dialback_("jabber:server:dialback");
     76   return ns_dialback_;
     77 }
     78 
     79 const std::string & Constants::ns_session() {
     80   static const std::string ns_session_("urn:ietf:params:xml:ns:xmpp-session");
     81   return ns_session_;
     82 }
     83 
     84 const std::string & Constants::ns_stanza() {
     85   static const std::string ns_stanza_("urn:ietf:params:xml:ns:xmpp-stanzas");
     86   return ns_stanza_;
     87 }
     88 
     89 const std::string & Constants::ns_privacy() {
     90   static const std::string ns_privacy_("jabber:iq:privacy");
     91   return ns_privacy_;
     92 }
     93 
     94 const std::string & Constants::ns_roster() {
     95   static const std::string ns_roster_("jabber:iq:roster");
     96   return ns_roster_;
     97 }
     98 
     99 const std::string & Constants::ns_vcard() {
    100   static const std::string ns_vcard_("vcard-temp");
    101   return ns_vcard_;
    102 }
    103 
    104 const std::string & Constants::ns_avatar_hash() {
    105   static const std::string ns_avatar_hash_("google:avatar");
    106   return ns_avatar_hash_;
    107 }
    108 
    109 const std::string & Constants::ns_vcard_update() {
    110   static const std::string ns_vcard_update_("vcard-temp:x:update");
    111   return ns_vcard_update_;
    112 }
    113 
    114 const std::string & Constants::str_client() {
    115   static const std::string str_client_("client");
    116   return str_client_;
    117 }
    118 
    119 const std::string & Constants::str_server() {
    120   static const std::string str_server_("server");
    121   return str_server_;
    122 }
    123 
    124 const std::string & Constants::str_stream() {
    125   static const std::string str_stream_("stream");
    126   return str_stream_;
    127 }
    128 
    129 const std::string STR_GET("get");
    130 const std::string STR_SET("set");
    131 const std::string STR_RESULT("result");
    132 const std::string STR_ERROR("error");
    133 
    134 
    135 const std::string STR_FROM("from");
    136 const std::string STR_TO("to");
    137 const std::string STR_BOTH("both");
    138 const std::string STR_REMOVE("remove");
    139 
    140 const std::string STR_UNAVAILABLE("unavailable");
    141 
    142 const std::string STR_GOOGLE_COM("google.com");
    143 const std::string STR_GMAIL_COM("gmail.com");
    144 const std::string STR_GOOGLEMAIL_COM("googlemail.com");
    145 const std::string STR_DEFAULT_DOMAIN("default.talk.google.com");
    146 const std::string STR_TALK_GOOGLE_COM("talk.google.com");
    147 const std::string STR_TALKX_L_GOOGLE_COM("talkx.l.google.com");
    148 
    149 const std::string STR_X("x");
    150 
    151 #ifdef FEATURE_ENABLE_VOICEMAIL
    152 const std::string STR_VOICEMAIL("voicemail");
    153 const std::string STR_OUTGOINGVOICEMAIL("outgoingvoicemail");
    154 #endif
    155 
    156 const QName QN_STREAM_STREAM(true, NS_STREAM, STR_STREAM);
    157 const QName QN_STREAM_FEATURES(true, NS_STREAM, "features");
    158 const QName QN_STREAM_ERROR(true, NS_STREAM, "error");
    159 
    160 const QName QN_XSTREAM_BAD_FORMAT(true, NS_XSTREAM, "bad-format");
    161 const QName QN_XSTREAM_BAD_NAMESPACE_PREFIX(true, NS_XSTREAM, "bad-namespace-prefix");
    162 const QName QN_XSTREAM_CONFLICT(true, NS_XSTREAM, "conflict");
    163 const QName QN_XSTREAM_CONNECTION_TIMEOUT(true, NS_XSTREAM, "connection-timeout");
    164 const QName QN_XSTREAM_HOST_GONE(true, NS_XSTREAM, "host-gone");
    165 const QName QN_XSTREAM_HOST_UNKNOWN(true, NS_XSTREAM, "host-unknown");
    166 const QName QN_XSTREAM_IMPROPER_ADDRESSIING(true, NS_XSTREAM, "improper-addressing");
    167 const QName QN_XSTREAM_INTERNAL_SERVER_ERROR(true, NS_XSTREAM, "internal-server-error");
    168 const QName QN_XSTREAM_INVALID_FROM(true, NS_XSTREAM, "invalid-from");
    169 const QName QN_XSTREAM_INVALID_ID(true, NS_XSTREAM, "invalid-id");
    170 const QName QN_XSTREAM_INVALID_NAMESPACE(true, NS_XSTREAM, "invalid-namespace");
    171 const QName QN_XSTREAM_INVALID_XML(true, NS_XSTREAM, "invalid-xml");
    172 const QName QN_XSTREAM_NOT_AUTHORIZED(true, NS_XSTREAM, "not-authorized");
    173 const QName QN_XSTREAM_POLICY_VIOLATION(true, NS_XSTREAM, "policy-violation");
    174 const QName QN_XSTREAM_REMOTE_CONNECTION_FAILED(true, NS_XSTREAM, "remote-connection-failed");
    175 const QName QN_XSTREAM_RESOURCE_CONSTRAINT(true, NS_XSTREAM, "resource-constraint");
    176 const QName QN_XSTREAM_RESTRICTED_XML(true, NS_XSTREAM, "restricted-xml");
    177 const QName QN_XSTREAM_SEE_OTHER_HOST(true, NS_XSTREAM, "see-other-host");
    178 const QName QN_XSTREAM_SYSTEM_SHUTDOWN(true, NS_XSTREAM, "system-shutdown");
    179 const QName QN_XSTREAM_UNDEFINED_CONDITION(true, NS_XSTREAM, "undefined-condition");
    180 const QName QN_XSTREAM_UNSUPPORTED_ENCODING(true, NS_XSTREAM, "unsupported-encoding");
    181 const QName QN_XSTREAM_UNSUPPORTED_STANZA_TYPE(true, NS_XSTREAM, "unsupported-stanza-type");
    182 const QName QN_XSTREAM_UNSUPPORTED_VERSION(true, NS_XSTREAM, "unsupported-version");
    183 const QName QN_XSTREAM_XML_NOT_WELL_FORMED(true, NS_XSTREAM, "xml-not-well-formed");
    184 const QName QN_XSTREAM_TEXT(true, NS_XSTREAM, "text");
    185 
    186 const QName QN_TLS_STARTTLS(true, NS_TLS, "starttls");
    187 const QName QN_TLS_REQUIRED(true, NS_TLS, "required");
    188 const QName QN_TLS_PROCEED(true, NS_TLS, "proceed");
    189 const QName QN_TLS_FAILURE(true, NS_TLS, "failure");
    190 
    191 const QName QN_SASL_MECHANISMS(true, NS_SASL, "mechanisms");
    192 const QName QN_SASL_MECHANISM(true, NS_SASL, "mechanism");
    193 const QName QN_SASL_AUTH(true, NS_SASL, "auth");
    194 const QName QN_SASL_CHALLENGE(true, NS_SASL, "challenge");
    195 const QName QN_SASL_RESPONSE(true, NS_SASL, "response");
    196 const QName QN_SASL_ABORT(true, NS_SASL, "abort");
    197 const QName QN_SASL_SUCCESS(true, NS_SASL, "success");
    198 const QName QN_SASL_FAILURE(true, NS_SASL, "failure");
    199 const QName QN_SASL_ABORTED(true, NS_SASL, "aborted");
    200 const QName QN_SASL_INCORRECT_ENCODING(true, NS_SASL, "incorrect-encoding");
    201 const QName QN_SASL_INVALID_AUTHZID(true, NS_SASL, "invalid-authzid");
    202 const QName QN_SASL_INVALID_MECHANISM(true, NS_SASL, "invalid-mechanism");
    203 const QName QN_SASL_MECHANISM_TOO_WEAK(true, NS_SASL, "mechanism-too-weak");
    204 const QName QN_SASL_NOT_AUTHORIZED(true, NS_SASL, "not-authorized");
    205 const QName QN_SASL_TEMPORARY_AUTH_FAILURE(true, NS_SASL, "temporary-auth-failure");
    206 
    207 const QName QN_DIALBACK_RESULT(true, NS_DIALBACK, "result");
    208 const QName QN_DIALBACK_VERIFY(true, NS_DIALBACK, "verify");
    209 
    210 const QName QN_STANZA_BAD_REQUEST(true, NS_STANZA, "bad-request");
    211 const QName QN_STANZA_CONFLICT(true, NS_STANZA, "conflict");
    212 const QName QN_STANZA_FEATURE_NOT_IMPLEMENTED(true, NS_STANZA, "feature-not-implemented");
    213 const QName QN_STANZA_FORBIDDEN(true, NS_STANZA, "forbidden");
    214 const QName QN_STANZA_GONE(true, NS_STANZA, "gone");
    215 const QName QN_STANZA_INTERNAL_SERVER_ERROR(true, NS_STANZA, "internal-server-error");
    216 const QName QN_STANZA_ITEM_NOT_FOUND(true, NS_STANZA, "item-not-found");
    217 const QName QN_STANZA_JID_MALFORMED(true, NS_STANZA, "jid-malformed");
    218 const QName QN_STANZA_NOT_ACCEPTABLE(true, NS_STANZA, "not-acceptable");
    219 const QName QN_STANZA_NOT_ALLOWED(true, NS_STANZA, "not-allowed");
    220 const QName QN_STANZA_PAYMENT_REQUIRED(true, NS_STANZA, "payment-required");
    221 const QName QN_STANZA_RECIPIENT_UNAVAILABLE(true, NS_STANZA, "recipient-unavailable");
    222 const QName QN_STANZA_REDIRECT(true, NS_STANZA, "redirect");
    223 const QName QN_STANZA_REGISTRATION_REQUIRED(true, NS_STANZA, "registration-required");
    224 const QName QN_STANZA_REMOTE_SERVER_NOT_FOUND(true, NS_STANZA, "remote-server-not-found");
    225 const QName QN_STANZA_REMOTE_SERVER_TIMEOUT(true, NS_STANZA, "remote-server-timeout");
    226 const QName QN_STANZA_RESOURCE_CONSTRAINT(true, NS_STANZA, "resource-constraint");
    227 const QName QN_STANZA_SERVICE_UNAVAILABLE(true, NS_STANZA, "service-unavailable");
    228 const QName QN_STANZA_SUBSCRIPTION_REQUIRED(true, NS_STANZA, "subscription-required");
    229 const QName QN_STANZA_UNDEFINED_CONDITION(true, NS_STANZA, "undefined-condition");
    230 const QName QN_STANZA_UNEXPECTED_REQUEST(true, NS_STANZA, "unexpected-request");
    231 const QName QN_STANZA_TEXT(true, NS_STANZA, "text");
    232 
    233 const QName QN_BIND_BIND(true, NS_BIND, "bind");
    234 const QName QN_BIND_RESOURCE(true, NS_BIND, "resource");
    235 const QName QN_BIND_JID(true, NS_BIND, "jid");
    236 
    237 const QName QN_MESSAGE(true, NS_CLIENT, "message");
    238 const QName QN_BODY(true, NS_CLIENT, "body");
    239 const QName QN_SUBJECT(true, NS_CLIENT, "subject");
    240 const QName QN_THREAD(true, NS_CLIENT, "thread");
    241 const QName QN_PRESENCE(true, NS_CLIENT, "presence");
    242 const QName QN_SHOW(true, NS_CLIENT, "show");
    243 const QName QN_STATUS(true, NS_CLIENT, "status");
    244 const QName QN_LANG(true, NS_CLIENT, "lang");
    245 const QName QN_PRIORITY(true, NS_CLIENT, "priority");
    246 const QName QN_IQ(true, NS_CLIENT, "iq");
    247 const QName QN_ERROR(true, NS_CLIENT, "error");
    248 
    249 const QName QN_SERVER_MESSAGE(true, NS_SERVER, "message");
    250 const QName QN_SERVER_BODY(true, NS_SERVER, "body");
    251 const QName QN_SERVER_SUBJECT(true, NS_SERVER, "subject");
    252 const QName QN_SERVER_THREAD(true, NS_SERVER, "thread");
    253 const QName QN_SERVER_PRESENCE(true, NS_SERVER, "presence");
    254 const QName QN_SERVER_SHOW(true, NS_SERVER, "show");
    255 const QName QN_SERVER_STATUS(true, NS_SERVER, "status");
    256 const QName QN_SERVER_LANG(true, NS_SERVER, "lang");
    257 const QName QN_SERVER_PRIORITY(true, NS_SERVER, "priority");
    258 const QName QN_SERVER_IQ(true, NS_SERVER, "iq");
    259 const QName QN_SERVER_ERROR(true, NS_SERVER, "error");
    260 
    261 const QName QN_SESSION_SESSION(true, NS_SESSION, "session");
    262 
    263 const QName QN_PRIVACY_QUERY(true, NS_PRIVACY, "query");
    264 const QName QN_PRIVACY_ACTIVE(true, NS_PRIVACY, "active");
    265 const QName QN_PRIVACY_DEFAULT(true, NS_PRIVACY, "default");
    266 const QName QN_PRIVACY_LIST(true, NS_PRIVACY, "list");
    267 const QName QN_PRIVACY_ITEM(true, NS_PRIVACY, "item");
    268 const QName QN_PRIVACY_IQ(true, NS_PRIVACY, "iq");
    269 const QName QN_PRIVACY_MESSAGE(true, NS_PRIVACY, "message");
    270 const QName QN_PRIVACY_PRESENCE_IN(true, NS_PRIVACY, "presence-in");
    271 const QName QN_PRIVACY_PRESENCE_OUT(true, NS_PRIVACY, "presence-out");
    272 
    273 const QName QN_ROSTER_QUERY(true, NS_ROSTER, "query");
    274 const QName QN_ROSTER_ITEM(true, NS_ROSTER, "item");
    275 const QName QN_ROSTER_GROUP(true, NS_ROSTER, "group");
    276 
    277 const QName QN_VCARD(true, NS_VCARD, "vCard");
    278 const QName QN_VCARD_FN(true, NS_VCARD, "FN");
    279 const QName QN_VCARD_PHOTO(true, NS_VCARD, "PHOTO");
    280 const QName QN_VCARD_PHOTO_BINVAL(true, NS_VCARD, "BINVAL");
    281 const QName QN_VCARD_AVATAR_HASH(true, NS_AVATAR_HASH, "hash");
    282 const QName QN_VCARD_AVATAR_HASH_MODIFIED(true, NS_AVATAR_HASH, "modified");
    283 
    284 const buzz::QName QN_NAME(true, STR_EMPTY, "name");
    285 const buzz::QName QN_AFFILIATION(true, STR_EMPTY, "affiliation");
    286 const buzz::QName QN_ROLE(true, STR_EMPTY, "role");
    287 
    288 #if defined(FEATURE_ENABLE_PSTN)
    289 const QName QN_VCARD_TEL(true, NS_VCARD, "TEL");
    290 const QName QN_VCARD_VOICE(true, NS_VCARD, "VOICE");
    291 const QName QN_VCARD_HOME(true, NS_VCARD, "HOME");
    292 const QName QN_VCARD_WORK(true, NS_VCARD, "WORK");
    293 const QName QN_VCARD_CELL(true, NS_VCARD, "CELL");
    294 const QName QN_VCARD_NUMBER(true, NS_VCARD, "NUMBER");
    295 #endif
    296 
    297 const QName QN_XML_LANG(true, NS_XML, "lang");
    298 
    299 const std::string STR_TYPE("type");
    300 const std::string STR_ID("id");
    301 const std::string STR_NAME("name");
    302 const std::string STR_JID("jid");
    303 const std::string STR_SUBSCRIPTION("subscription");
    304 const std::string STR_ASK("ask");
    305 
    306 const QName QN_ENCODING(true, STR_EMPTY, STR_ENCODING);
    307 const QName QN_VERSION(true, STR_EMPTY, STR_VERSION);
    308 const QName QN_TO(true, STR_EMPTY, "to");
    309 const QName QN_FROM(true, STR_EMPTY, "from");
    310 const QName QN_TYPE(true, STR_EMPTY, "type");
    311 const QName QN_ID(true, STR_EMPTY, "id");
    312 const QName QN_CODE(true, STR_EMPTY, "code");
    313 
    314 const QName QN_VALUE(true, STR_EMPTY, "value");
    315 const QName QN_ACTION(true, STR_EMPTY, "action");
    316 const QName QN_ORDER(true, STR_EMPTY, "order");
    317 const QName QN_MECHANISM(true, STR_EMPTY, "mechanism");
    318 const QName QN_ASK(true, STR_EMPTY, "ask");
    319 const QName QN_JID(true, STR_EMPTY, "jid");
    320 const QName QN_SUBSCRIPTION(true, STR_EMPTY, "subscription");
    321 const QName QN_TITLE1(true, STR_EMPTY, "title1");
    322 const QName QN_TITLE2(true, STR_EMPTY, "title2");
    323 const QName QN_SOURCE(true, STR_EMPTY, "source");
    324 
    325 const QName QN_XMLNS_CLIENT(true, NS_XMLNS, STR_CLIENT);
    326 const QName QN_XMLNS_SERVER(true, NS_XMLNS, STR_SERVER);
    327 const QName QN_XMLNS_STREAM(true, NS_XMLNS, STR_STREAM);
    328 
    329 
    330 
    331 // Presence
    332 const std::string STR_SHOW_AWAY("away");
    333 const std::string STR_SHOW_CHAT("chat");
    334 const std::string STR_SHOW_DND("dnd");
    335 const std::string STR_SHOW_XA("xa");
    336 const std::string STR_SHOW_OFFLINE("offline");
    337 
    338 // Subscription
    339 const std::string STR_SUBSCRIBE("subscribe");
    340 const std::string STR_SUBSCRIBED("subscribed");
    341 const std::string STR_UNSUBSCRIBE("unsubscribe");
    342 const std::string STR_UNSUBSCRIBED("unsubscribed");
    343 
    344 // Google Invite
    345 const std::string NS_GOOGLE_INVITE("google:subscribe");
    346 const QName QN_INVITATION(true, NS_GOOGLE_INVITE, "invitation");
    347 const QName QN_INVITE_NAME(true, NS_GOOGLE_INVITE, "name");
    348 const QName QN_INVITE_SUBJECT(true, NS_GOOGLE_INVITE, "subject");
    349 const QName QN_INVITE_MESSAGE(true, NS_GOOGLE_INVITE, "body");
    350 
    351 // JEP 0030
    352 const QName QN_NODE(true, STR_EMPTY, "node");
    353 const QName QN_CATEGORY(true, STR_EMPTY, "category");
    354 const QName QN_VAR(true, STR_EMPTY, "var");
    355 const std::string NS_DISCO_INFO("http://jabber.org/protocol/disco#info");
    356 const std::string NS_DISCO_ITEMS("http://jabber.org/protocol/disco#items");
    357 const QName QN_DISCO_INFO_QUERY(true, NS_DISCO_INFO, "query");
    358 const QName QN_DISCO_IDENTITY(true, NS_DISCO_INFO, "identity");
    359 const QName QN_DISCO_FEATURE(true, NS_DISCO_INFO, "feature");
    360 
    361 const QName QN_DISCO_ITEMS_QUERY(true, NS_DISCO_ITEMS, "query");
    362 const QName QN_DISCO_ITEM(true, NS_DISCO_ITEMS, "item");
    363 
    364 const std::string NS_MUC_USER("http://jabber.org/protocol/muc#user");
    365 const QName QN_MUC_USER_CONTINUE(true, NS_MUC_USER, "continue");
    366 const QName QN_MUC_USER_X(true, NS_MUC_USER, "x");
    367 const QName QN_MUC_USER_ITEM(true, NS_MUC_USER, "item");
    368 const QName QN_MUC_USER_STATUS(true, NS_MUC_USER, "status");
    369 
    370 // JEP 0115
    371 const std::string NS_CAPS("http://jabber.org/protocol/caps");
    372 const QName QN_CAPS_C(true, NS_CAPS, "c");
    373 const QName QN_VER(true, STR_EMPTY, "ver");
    374 const QName QN_EXT(true, STR_EMPTY, "ext");
    375 
    376 // JEP 0153
    377 const std::string kNSVCard("vcard-temp:x:update");
    378 const QName kQnVCardX(true, kNSVCard, "x");
    379 const QName kQnVCardPhoto(true, kNSVCard, "photo");
    380 
    381 // JEP 0172 User Nickname
    382 const std::string kNSNickname("http://jabber.org/protocol/nick");
    383 const QName kQnNickname(true, kNSNickname, "nick");
    384 
    385 
    386 // JEP 0085 chat state
    387 const std::string NS_CHATSTATE("http://jabber.org/protocol/chatstates");
    388 const QName QN_CS_ACTIVE(true, NS_CHATSTATE, "active");
    389 const QName QN_CS_COMPOSING(true, NS_CHATSTATE, "composing");
    390 const QName QN_CS_PAUSED(true, NS_CHATSTATE, "paused");
    391 const QName QN_CS_INACTIVE(true, NS_CHATSTATE, "inactive");
    392 const QName QN_CS_GONE(true, NS_CHATSTATE, "gone");
    393 
    394 // JEP 0091 Delayed Delivery
    395 const std::string kNSDelay("jabber:x:delay");
    396 const QName kQnDelayX(true, kNSDelay, "x");
    397 const QName kQnStamp(true, STR_EMPTY, "stamp");
    398 
    399 // Google time stamping (higher resolution)
    400 const std::string kNSTimestamp("google:timestamp");
    401 const QName kQnTime(true, kNSTimestamp, "time");
    402 const QName kQnMilliseconds(true, STR_EMPTY, "ms");
    403 
    404 
    405 // Event tracking
    406 #ifdef FEATURE_ENABLE_TRACKING
    407 const std::string NS_GOOGLE_EVENT_TRACKING("google:client-usability-testing");
    408 const QName QN_EVENT_TRACKING(true, NS_GOOGLE_EVENT_TRACKING, "usage-stats");
    409 const QName QN_EVENT_TRACKING_BRANDID(true, NS_GOOGLE_EVENT_TRACKING, "bid");
    410 const QName QN_EVENT_TRACKING_EVENT(true, NS_GOOGLE_EVENT_TRACKING, "event");
    411 const QName QN_EVENT_TRACKING_VARIABLE_KEY(true, STR_EMPTY, "key");
    412 const QName QN_EVENT_TRACKING_VARIABLE_VALUE(true, STR_EMPTY, "value");
    413 const QName QN_EVENT_TRACKING_VARIABLE_TIME(true, STR_EMPTY, "time");
    414 const QName QN_EVENT_TRACKING_EVENT_GROUP(true,
    415                                           NS_GOOGLE_EVENT_TRACKING, "events");
    416 #endif
    417 
    418 
    419 // Jingle Info
    420 const std::string NS_JINGLE_INFO("google:jingleinfo");
    421 const QName QN_JINGLE_INFO_QUERY(true, NS_JINGLE_INFO, "query");
    422 const QName QN_JINGLE_INFO_STUN(true, NS_JINGLE_INFO, "stun");
    423 const QName QN_JINGLE_INFO_RELAY(true, NS_JINGLE_INFO, "relay");
    424 const QName QN_JINGLE_INFO_SERVER(true, NS_JINGLE_INFO, "server");
    425 const QName QN_JINGLE_INFO_TOKEN(true, NS_JINGLE_INFO, "token");
    426 const QName QN_JINGLE_INFO_HOST(true, STR_EMPTY, "host");
    427 const QName QN_JINGLE_INFO_TCP(true, STR_EMPTY, "tcp");
    428 const QName QN_JINGLE_INFO_UDP(true, STR_EMPTY, "udp");
    429 const QName QN_JINGLE_INFO_TCPSSL(true, STR_EMPTY, "tcpssl");
    430 
    431 // Call Performance Logging
    432 const std::string NS_GOOGLE_CALLPERF_STATS("google:call-perf-stats");
    433 const QName QN_CALLPERF_STATS(true, NS_GOOGLE_CALLPERF_STATS, "callPerfStats");
    434 const QName QN_CALLPERF_SESSIONID(true, STR_EMPTY, "sessionId");
    435 const QName QN_CALLPERF_LOCALUSER(true, STR_EMPTY, "localUser");
    436 const QName QN_CALLPERF_REMOTEUSER(true, STR_EMPTY, "remoteUser");
    437 const QName QN_CALLPERF_STARTTIME(true, STR_EMPTY, "startTime");
    438 const QName QN_CALLPERF_CALL_LENGTH(true, STR_EMPTY, "callLength");
    439 const QName QN_CALLPERF_DATAPOINT(true, NS_GOOGLE_CALLPERF_STATS, "dataPoint");
    440 const QName QN_CALLPERF_DATAPOINT_TIME(true, STR_EMPTY, "timeStamp");
    441 const QName QN_CALLPERF_DATAPOINT_FRACTION_LOST(true, STR_EMPTY, "fraction_lost");
    442 const QName QN_CALLPERF_DATAPOINT_CUM_LOST(true, STR_EMPTY, "cum_lost");
    443 const QName QN_CALLPERF_DATAPOINT_EXT_MAX(true, STR_EMPTY, "ext_max");
    444 const QName QN_CALLPERF_DATAPOINT_JITTER(true, STR_EMPTY, "jitter");
    445 const QName QN_CALLPERF_DATAPOINT_RTT(true, STR_EMPTY, "RTT");
    446 const QName QN_CALLPERF_DATAPOINT_BYTES_R(true, STR_EMPTY, "bytesReceived");
    447 const QName QN_CALLPERF_DATAPOINT_PACKETS_R(true, STR_EMPTY, "packetsReceived");
    448 const QName QN_CALLPERF_DATAPOINT_BYTES_S(true, STR_EMPTY, "bytesSent");
    449 const QName QN_CALLPERF_DATAPOINT_PACKETS_S(true, STR_EMPTY, "packetsSent");
    450 const QName QN_CALLPERF_CONNECTION(true, NS_GOOGLE_CALLPERF_STATS, "connection");
    451 const QName QN_CALLPERF_CONNECTION_LOCAL_ADDRESS(true, STR_EMPTY, "localAddress");
    452 const QName QN_CALLPERF_CONNECTION_REMOTE_ADDRESS(true, STR_EMPTY, "remoteAddress");
    453 
    454 // Muc invites.
    455 const QName QN_MUC_USER_INVITE(true, NS_MUC_USER, "invite");
    456 
    457 // Multiway audio/video.
    458 const std::string NS_GOOGLE_MUC_USER("google:muc#user");
    459 const QName QN_GOOGLE_MUC_USER_AVAILABLE_MEDIA(true, NS_GOOGLE_MUC_USER, "available-media");
    460 const QName QN_GOOGLE_MUC_USER_ENTRY(true, NS_GOOGLE_MUC_USER, "entry");
    461 const QName QN_GOOGLE_MUC_USER_MEDIA(true, NS_GOOGLE_MUC_USER, "media");
    462 const QName QN_GOOGLE_MUC_USER_TYPE(true, NS_GOOGLE_MUC_USER, "type");
    463 const QName QN_GOOGLE_MUC_USER_SRC_ID(true, NS_GOOGLE_MUC_USER, "src-id");
    464 const QName QN_GOOGLE_MUC_USER_STATUS(true, NS_GOOGLE_MUC_USER, "status");
    465 const QName QN_LABEL(true, STR_EMPTY, "label");
    466 
    467 }
    468