Группа :: Система/Серверы
Пакет: ejabberd-jit
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: ejabberd-jit-1.1.7-search.patch
--- jit/jit/src/SNAC-SRV.cpp.orig 2003-01-10 00:41:56 +1200
+++ jit/jit/src/SNAC-SRV.cpp 2006-11-30 15:27:01 +1200
@@ -216,32 +216,66 @@
b << (unsigned short)2000 /* type 9808 */
<< (unsigned short)m_requestID /* low word of the request ID */
- << (unsigned short)0x0533; /* subtype wp-full-request */
- b.PackUint16TranslatedNull(m_firstname);
- b.PackUint16TranslatedNull(m_lastname);
- b.PackUint16TranslatedNull(m_nickname);
- b.PackUint16TranslatedNull(m_email);
- b << (unsigned short)m_min_age; // minimum age
- b << (unsigned short)m_max_age; // maximum age
- b << (unsigned char)m_sex; // sex
- b << (unsigned char)m_language; // language
- b.PackUint16TranslatedNull(m_city); // city
- b.PackUint16TranslatedNull(m_state); // state
- b << (unsigned short)m_country; // country
- b.PackUint16TranslatedNull(m_company_name); // company name
- b.PackUint16TranslatedNull(m_department); // department
- b.PackUint16TranslatedNull(m_position); // position
- b << (unsigned char)0x00; // occupation
- b << (unsigned short)0x0000; // past info category
- b.PackUint16TranslatedNull(""); // description
- b << (unsigned short)0x0000; // interests category
- b.PackUint16TranslatedNull(""); // description
- b << (unsigned short)0x0000; // affiliation/organization
- b.PackUint16TranslatedNull(""); // description
- b << (unsigned short)0x0000; // homepage category
- b.PackUint16TranslatedNull(""); // description
- b << (unsigned char)(m_only_online ? 0x01 : 0x00);
- // only-online flag
+ << (unsigned short)0x055f; /* subtype wp-full-request */
+
+ Buffer::marker m3;
+
+ if (m_firstname.size()) {
+ b << (unsigned short)0x0140;
+ m3 = b.getAutoSizeShortMarker();
+ b.PackUint16TranslatedNull(m_firstname);
+ b.setAutoSizeMarker(m3);
+ }
+
+ if (m_lastname.size()) {
+ b << (unsigned short)0x014A;
+ m3 = b.getAutoSizeShortMarker();
+ b.PackUint16TranslatedNull(m_lastname);
+ b.setAutoSizeMarker(m3);
+ }
+
+ if (m_nickname.size()) {
+ b << (unsigned short)0x0154;
+ m3 = b.getAutoSizeShortMarker();
+ b.PackUint16TranslatedNull(m_nickname);
+ b.setAutoSizeMarker(m3);
+ }
+
+ if (m_email.size()) {
+ b << (unsigned short)0x015e;
+ m3 = b.getAutoSizeShortMarker();
+ b.PackUint16TranslatedNull(m_email);
+ b.setAutoSizeMarker(m3);
+ }
+
+ if (m_min_age < m_max_age) {
+ b << (unsigned short)0x0168
+ << (unsigned short)0x0004
+ << (unsigned short)m_min_age // minimum age
+ << (unsigned short)m_max_age; // maximum age
+ }
+
+ if (m_sex) {
+ b << (unsigned short)0x017c
+ << (unsigned short)0x0001
+ << (unsigned char)m_sex; // sex
+ }
+
+// b << (unsigned char)m_language; // language
+
+ if (m_city.size()) {
+ b << (unsigned short)0x0190;
+ m3 = b.getAutoSizeShortMarker();
+ b.PackUint16TranslatedNull(m_city);
+ b.setAutoSizeMarker(m3);
+ }
+
+ if (m_only_online) {
+ b << (unsigned short)0x0230
+ << (unsigned short)0x0001
+ << (unsigned char)0x01; // only-online flag
+ }
+
b.setAutoSizeMarker(m1);
b.setAutoSizeMarker(m2);
}