diff -Naur --exclude='*orig' psi-0.10-test3-orig/iris/include/im.h psi-0.10-test3/iris/include/im.h --- psi-0.10-test3-orig/iris/include/im.h 2005-11-07 00:40:09.000000000 +0000 +++ psi-0.10-test3/iris/include/im.h 2005-11-07 01:38:14.000000000 +0000 @@ -191,6 +191,16 @@ void setXSigned(const QString &); void setSongTitle(const QString &); + + // JEP-8 Avatars + const QString& avatarHash() const; + void setAvatarHash(const QString&); + bool hasAvatarHash() const; + + // iChat avatars + const QString& photoHash() const; + void setPhotoHash(const QString&); + bool hasPhotoHash() const; /* These are for MUC support */ bool isMuc() const; @@ -234,6 +244,14 @@ private: class Private; Private *d; + + // JEP-8 Avatars + QString v_avatarHash; + bool v_hasAvatarHash; + + // iChat Avatars + QString v_photoHash; + bool v_hasPhotoHash; }; class Resource diff -Naur --exclude='*orig' psi-0.10-test3-orig/iris/xmpp-im/types.cpp psi-0.10-test3/iris/xmpp-im/types.cpp --- psi-0.10-test3-orig/iris/xmpp-im/types.cpp 2005-11-07 00:40:09.000000000 +0000 +++ psi-0.10-test3/iris/xmpp-im/types.cpp 2005-11-07 01:42:54.000000000 +0000 @@ -827,6 +827,8 @@ d->v_show = show; d->v_status = status; d->v_priority = priority; + v_hasAvatarHash = false; + v_hasPhotoHash = false; } Status::Status(const Status &from) @@ -902,6 +904,38 @@ d->v_songTitle = _songtitle; } +const QString& Status::avatarHash() const +{ + return v_avatarHash; +} + +void Status::setAvatarHash(const QString& h) +{ + v_avatarHash = h; + v_hasAvatarHash = true; +} + +bool Status::hasAvatarHash() const +{ + return v_hasAvatarHash; +} + +const QString& Status::photoHash() const +{ + return v_photoHash; +} + +void Status::setPhotoHash(const QString& h) +{ + v_photoHash = h; + v_hasPhotoHash = true; +} + +bool Status::hasPhotoHash() const +{ + return v_hasPhotoHash; +} + bool Status::isAvailable() const { return d->v_isAvailable; diff -Naur --exclude='*orig' psi-0.10-test3-orig/iris/xmpp-im/xmpp_tasks.cpp psi-0.10-test3/iris/xmpp-im/xmpp_tasks.cpp --- psi-0.10-test3-orig/iris/xmpp-im/xmpp_tasks.cpp 2005-11-07 00:40:09.000000000 +0000 +++ psi-0.10-test3/iris/xmpp-im/xmpp_tasks.cpp 2005-11-07 01:30:50.000000000 +0000 @@ -517,6 +517,18 @@ x.setAttribute("xmlns", "jabber:x:signed"); tag.appendChild(x); } + if(s.hasAvatarHash()) { + QDomElement x = doc()->createElement("x"); + x.setAttribute("xmlns", "jabber:x:avatar"); + x.appendChild(textTag(doc(), "hash", s.avatarHash())); + tag.appendChild(x); + } + if(s.hasPhotoHash()) { + QDomElement x = doc()->createElement("x"); + x.setAttribute("xmlns", "vcard-temp:x:update"); + x.appendChild(textTag(doc(), "photo", s.avatarHash())); + tag.appendChild(x); + } } if(s.isMuc()) { @@ -665,6 +677,24 @@ else if(i.tagName() == "x" && i.attribute("xmlns") == "http://jabber.org/protocol/e2e") { p.setKeyID(tagContent(i)); } + else if(i.tagName() == "x" && i.attribute("xmlns") == "jabber:x:avatar") { + QDomElement t; + bool found; + t = findSubTag(i, "hash", &found); + if (found) + p.setAvatarHash(tagContent(t)); + else + p.setAvatarHash(""); + } + else if(i.tagName() == "x" && i.attribute("xmlns") == "vcard-temp:x:update") { + QDomElement t; + bool found; + t = findSubTag(i, "photo", &found); + if (found) + p.setPhotoHash(tagContent(t)); + else + p.setPhotoHash(""); + } else if(i.tagName() == "x" && i.attribute("xmlns") == "http://jabber.org/protocol/muc") { p.setMuc(true); QDomElement t;