-std::ostringstream stream;
-
-// Conf
-
-appendResetableTag(stream, "credit", conf.credit);
-appendResetableTag(stream, "creditExpire", conf.creditExpire);
-appendResetableTag(stream, "password", conf.password);
-appendResetableTag(stream, "down", conf.disabled); // TODO: down -> disabled
-appendResetableTag(stream, "passive", conf.passive);
-appendResetableTag(stream, "disableDetailStat", conf.disabledDetailStat); // TODO: disable -> disabled
-appendResetableTag(stream, "aonline", conf.alwaysOnline); // TODO: aonline -> alwaysOnline
-appendResetableTag(stream, "ip", conf.ips); // TODO: ip -> ips
-
-if (!conf.nextTariff.empty())
- stream << "<tariff delayed=\"" << conf.nextTariff.data() << "\"/>";
-else if (!conf.tariffName.empty())
- stream << "<tariff now=\"" << conf.tariffName.data() << "\"/>";
-
-appendResetableTag(stream, "note", MaybeEncode(MaybeIconv(conf.note, encoding, "koi8-ru")));
-appendResetableTag(stream, "name", MaybeEncode(MaybeIconv(conf.realName, encoding, "koi8-ru"))); // TODO: name -> realName
-appendResetableTag(stream, "address", MaybeEncode(MaybeIconv(conf.address, encoding, "koi8-ru")));
-appendResetableTag(stream, "email", MaybeEncode(MaybeIconv(conf.email, encoding, "koi8-ru")));
-appendResetableTag(stream, "phone", MaybeEncode(MaybeIconv(conf.phone, encoding, "cp1251")));
-appendResetableTag(stream, "group", MaybeEncode(MaybeIconv(conf.group, encoding, "koi8-ru")));
-appendResetableTag(stream, "corp", conf.corp);
-
-for (size_t i = 0; i < conf.userdata.size(); ++i)
- appendResetableTag(stream, "userdata", i, MaybeEncode(MaybeIconv(conf.userdata[i], encoding, "koi8-ru")));
-
-if (!conf.services.empty())
+ std::ostringstream stream;
+
+ // Conf
+
+ appendResetableTag(stream, "credit", conf.credit);
+ appendResetableTag(stream, "creditExpire", conf.creditExpire);
+ appendResetableTag(stream, "password", conf.password);
+ appendResetableTag(stream, "down", conf.disabled); // TODO: down -> disabled
+ appendResetableTag(stream, "passive", conf.passive);
+ appendResetableTag(stream, "disableDetailStat", conf.disabledDetailStat); // TODO: disable -> disabled
+ appendResetableTag(stream, "aonline", conf.alwaysOnline); // TODO: aonline -> alwaysOnline
+ appendResetableTag(stream, "ip", conf.ips); // TODO: ip -> ips
+
+ if (conf.nextTariff)
+ stream << "<tariff delayed=\"" << conf.nextTariff.value() << "\"/>";
+ else if (conf.tariffName)
+ stream << "<tariff now=\"" << conf.tariffName.value() << "\"/>";
+
+ appendResetableTag(stream, "note", maybeEncode(maybeIconv(conf.note, encoding, "koi8-ru")));
+ appendResetableTag(stream, "name", maybeEncode(maybeIconv(conf.realName, encoding, "koi8-ru"))); // TODO: name -> realName
+ appendResetableTag(stream, "address", maybeEncode(maybeIconv(conf.address, encoding, "koi8-ru")));
+ appendResetableTag(stream, "email", maybeEncode(maybeIconv(conf.email, encoding, "koi8-ru")));
+ appendResetableTag(stream, "phone", maybeEncode(maybeIconv(conf.phone, encoding, "cp1251")));
+ appendResetableTag(stream, "group", maybeEncode(maybeIconv(conf.group, encoding, "koi8-ru")));
+ appendResetableTag(stream, "corp", conf.corp);
+
+ for (size_t i = 0; i < conf.userdata.size(); ++i)
+ appendResetableTag(stream, "userdata", i, maybeEncode(maybeIconv(conf.userdata[i], encoding, "koi8-ru")));
+
+ if (conf.services)