Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
4989b429
Commit
4989b429
authored
Mar 03, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add strophe.vcard.js
parent
e3fa8325
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
Libraries/strophe.vcard.js
Libraries/strophe.vcard.js
+66
-0
No files found.
Libraries/strophe.vcard.js
0 → 100644
View file @
4989b429
// Generated by CoffeeScript 1.3.3
/*
Plugin to implement the vCard extension.
http://xmpp.org/extensions/xep-0054.html
Author: Nathan Zorn (nathan.zorn@gmail.com)
CoffeeScript port: Andreas Guth (guth@dbis.rwth-aachen.de)
*/
/* jslint configuration:
*/
/* global document, window, setTimeout, clearTimeout, console,
XMLHttpRequest, ActiveXObject,
Base64, MD5,
Strophe, $build, $msg, $iq, $pres
*/
var
buildIq
;
buildIq
=
function
(
type
,
jid
,
vCardEl
)
{
var
iq
;
iq
=
$iq
(
jid
?
{
type
:
type
,
to
:
jid
}
:
{
type
:
type
});
iq
.
c
(
"
vCard
"
,
{
xmlns
:
Strophe
.
NS
.
VCARD
});
if
(
vCardEl
)
{
iq
.
cnode
(
vCardEl
);
}
return
iq
;
};
Strophe
.
addConnectionPlugin
(
'
vcard
'
,
{
_connection
:
null
,
init
:
function
(
conn
)
{
this
.
_connection
=
conn
;
return
Strophe
.
addNamespace
(
'
VCARD
'
,
'
vcard-temp
'
);
},
/*Function
Retrieve a vCard for a JID/Entity
Parameters:
(Function) handler_cb - The callback function used to handle the request.
(String) jid - optional - The name of the entity to request the vCard
If no jid is given, this function retrieves the current user's vcard.
*/
get
:
function
(
handler_cb
,
jid
,
error_cb
)
{
var
iq
;
iq
=
buildIq
(
"
get
"
,
jid
);
return
this
.
_connection
.
sendIQ
(
iq
,
handler_cb
,
error_cb
);
},
/* Function
Set an entity's vCard.
*/
set
:
function
(
handler_cb
,
vCardEl
,
jid
,
error_cb
)
{
var
iq
;
iq
=
buildIq
(
"
set
"
,
jid
,
vCardEl
);
return
this
.
_connection
.
sendIQ
(
iq
,
handler_cb
,
error_rb
);
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment