1// Package xmpp implements the XMPP IM protocol, as specified in RFC 6120 and
2// 6121.
3package xmpp
4
5import (
6	"fmt"
7
8	"github.com/coyim/coyim/xmpp/data"
9)
10
11// RequestVCard requests the user's vcard from the server. It returns a
12// channel on which the reply can be read when received and a Cookie that can
13// be used to cancel the request.
14func (c *conn) RequestVCard() (<-chan data.Stanza, data.Cookie, error) {
15	cookie := c.getCookie()
16	if _, err := fmt.Fprintf(c.out, "<iq type='get' id='%x'><vCard xmlns='vcard-temp'/></iq>", cookie); err != nil {
17		return nil, 0, err
18	}
19
20	return c.createInflight(cookie, "")
21}
22