Mercurial > eldonilo > lightstring
comparison plugins/presence.js @ 30:1506992c33e2
Split plugins.js into multiple plugins.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 28 Jan 2012 01:50:22 +0100 |
parents | |
children | fbb08a31921d |
comparison
equal
deleted
inserted
replaced
28:630b9579fe4a | 30:1506992c33e2 |
---|---|
1 'use strict'; | |
2 | |
3 /** | |
4 Copyright (c) 2011, Sonny Piers <sonny at fastmail dot net> | |
5 | |
6 Permission to use, copy, modify, and/or distribute this software for any | |
7 purpose with or without fee is hereby granted, provided that the above | |
8 copyright notice and this permission notice appear in all copies. | |
9 | |
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 //////////// | |
20 //Presence// http://xmpp.org/rfcs/rfc6121.html#presence | |
21 //////////// | |
22 Lightstring.stanza.presence = function(aPriority) { | |
23 if(aPriority) | |
24 return "<presence><priority>"+aPriority+"</priority></presence>"; | |
25 else | |
26 return "<presence/>"; | |
27 }; | |
28 Lightstring.presence = function(aConnection, aPriority) { | |
29 aConnection.send(Lightstring.stanza.presence(aPriority)); | |
30 }; |