Esempio n. 1
0
void StatusPreset::fromXml(const QDomElement &el)
{
    // FIXME: This is the old format. Should be removed in the future
    if (el.tagName() == "item") {
        setName(el.attribute("name"));
        setMessage(el.text());
        return;
    }

    if (el.isNull() || el.tagName() != "preset")
        return;

    setName(el.attribute("name"));
    setMessage(el.text());
    if (el.hasAttribute("priority"))
        setPriority(el.attribute("priority").toInt());

    XMPP::Status status;
    status.setType(el.attribute("status", "away"));
    setStatus(status.type());
}
Esempio n. 2
0
	XMPP::Status toIrisStatus(Status status)
	{
		XMPP::Status s = XMPP::Status();
		const QString &type = status.type();

		if ("Online" == type)
			s.setType(XMPP::Status::Online);
		else if ("FreeForChat" == type)
			s.setType(XMPP::Status::FFC);
		else if ("DoNotDisturb" == type)
			s.setType(XMPP::Status::DND);
		else if ("NotAvailable" == type)
			s.setType(XMPP::Status::XA);
		else if ("Away" == type)
			s.setType(XMPP::Status::Away);
		else if ("Invisible" == type)
			s.setType(XMPP::Status::DND);
		else
			s.setType(XMPP::Status::Offline);

		s.setStatus(status.description());
		return s;
	}