2using System.Collections.Generic;
17 private byte[] data =
null;
18 private string sha1Hash =
null;
36 public override string Namespace =>
"urn:xmpp:avatar:data";
45 StringBuilder Xml =
new StringBuilder();
47 Xml.Append(
"<data xmlns='");
48 Xml.Append(this.Namespace);
50 Xml.Append(Convert.ToBase64String(
this.data));
51 Xml.Append(
"</data>");
53 return Xml.ToString();
64 if (this.sha1Hash is
null)
80 data = Convert.FromBase64String(E.InnerText)
User Avatar event, as defined in XEP-0084: https://xmpp.org/extensions/xep-0084.html
override string LocalName
Local name of the event element.
override string ItemId
Optional Item ID of event. If null, a new will automatically be generated by the server.
byte[] Data
Binary representation of avatar
override IPersonalEvent Parse(XmlElement E)
Parses a personal event from its XML representation
UserAvatar()
User Avatar event, as defined in XEP-0084: https://xmpp.org/extensions/xep-0084.html
override string PayloadXml
XML representation of the event.
override string Namespace
Namespace of the event element.
Contains methods for simple hash calculations.
static string ComputeSHA1HashString(byte[] Data)
Computes the SHA-1 hash of a block of binary data.
Interface for personal event objects.