Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Marcel Waldvogel edited this page Mar 19, 2016 · 1 revision

Variables

localStorage

The browser's localStorage variables all use a jsxc: prefix.

"Global" variables (applicable to all accounts)

Variables shared between all JSXC instances running in this browser, independent of the JIDs used. They are stored aslocalStorage["jsxc:"+globalVar], but should be accessed using getItem(), updateItem(), and removeItem(), where globalVar is one of:

  • jid, sid, rid: The active JID (Jabber ID), the BOSH Session ID (SID) and RID.
  • alive, alive_busy: Used for synchronization between tabs (master selection and keep-alive).
  • storageNotConform: As defined in the localStorage specs, a storage event should only be fired if a write is performed by a different browser tab. Internet Explorer does it for writes in the same tab as well. Values: 0=standards-compliant; 1=need to suppress same-tab events manually; 2=undecided.

Per-User variables

All account-specific variables are located under localStorage["jsxc:"+plainJid+":"+jidVar]. These variables should be used through getUserItem(), updateUserItem(), and removeUserItem() . The following jidVar are used as of JSXC 3.0:

  • avatar:own: The avatar for the logged-in JID ("me"). Avatars are stored as data elements, actual image base64-encoded.
  • avatar:<hex-string>: The image for other buddies' avatars (the hex string is the SHA1 hash of the image content)
  • defaultAvatars: ownCloud's avatars; fallback, if no XMPP avatar is available (only used in ownCloud).
  • key, priv_fingerprint: OTR key and fingerprint
  • iceValidity: Until when (seconds since 1970) the current TURN credentials are valid.
  • buddylist: JSON-style string; representing an array of buddy JIDs
  • buddy:<buddyJID>: The description of the buddy in a JSON-style string; representing a hash with
    • jid: The key again
    • name: The display name
    • status: Presence (0=offline, …, 5=available)
    • sub: Presence subscription status ("none", "to", "from", "both")
    • msgstate: OTR state (0=plaintext, 1=encrypted, 2=finished)
    • transferReq: OTR transition requested
    • fingerprint: OTR fingerprint or null
    • trust: OTR fingerprint verified (boolean)
    • type: Buddy type ("chat" for normal user, "groupchat" for MUC room)
    • res: For normal users: List of resources this buddy is currently logged in with (empty list if not logged in); for MUC: List of nicknames in this room.
    • subject, bookmarked, autojoin, nickname: MUC variables
  • res:<buddyJID>: The online status of the different resources (encoded in a JSON-style string)
  • options: The value of jsxc.options (encoded in a JSON-style string)
Clone this wiki locally