- data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>" << u->host << "</realhost><displayhost>" << u->dhost << "</displayhost>";
- data << "<gecos>" << Sanitize(u->fullname) << "</gecos><server>" << u->server << "</server><away>" << Sanitize(u->awaymsg) << "</away><opertype>" << Sanitize(u->oper) << "</opertype><modes>";
- std::string modes;
- for (unsigned char n = 'A'; n <= 'z'; ++n)
- if (u->IsModeSet(n))
- modes += n;
-
- data << modes << "</modes><ident>" << Sanitize(u->ident) << "</ident><port>" << u->GetPort() << "</port><ipaddress>" << u->GetIPString() << "</ipaddress>";
+ data << "<nickname>" << u->nick << "</nickname><uuid>" << u->uuid << "</uuid><realhost>"
+ << u->host << "</realhost><displayhost>" << u->dhost << "</displayhost><gecos>"
+ << Sanitize(u->fullname) << "</gecos><server>" << u->server << "</server>";
+ if (IS_AWAY(u))
+ data << "<away>" << Sanitize(u->awaymsg) << "</away><awaytime>" << u->awaytime << "</awaytime>";
+ if (IS_OPER(u))
+ data << "<opertype>" << Sanitize(u->oper->NameStr()) << "</opertype>";
+ data << "<modes>" << u->FormatModes() << "</modes><ident>" << Sanitize(u->ident) << "</ident>";
+ LocalUser* lu = IS_LOCAL(u);
+ if (lu)
+ data << "<port>" << lu->GetServerPort() << "</port><servaddr>"
+ << irc::sockets::satouser(lu->server_sa) << "</servaddr>";
+ data << "<ipaddress>" << u->GetIPString() << "</ipaddress>";
+
+ DumpMeta(data, u);
+