Hi, All

In 15 Feb 2002 Yip, Wai Peng ([EMAIL PROTECTED]) send bugreport, that
licq crash then search for a new user by UIN. This patch seems fix this
problem and searching by UIN work correctly now.

P.S. This and other my patches you can find at
ftp://heaven.kiyavia.crimea.ua/pub/patches/licq/latest/

SergK.
diff -urN licq/include/licq_packets.h licq-sk8/include/licq_packets.h
--- licq/include/licq_packets.h Mon Jan 28 11:22:28 2002
+++ licq-sk8/include/licq_packets.h     Fri Feb 15 10:29:55 2002
@@ -340,10 +340,12 @@
 
 
 //-----SearchByUin--------------------------------------------------------------
-class CPU_SearchByUin : public CPacketUdp
+class CPU_SearchByUin : public CPU_CommonFamily
 {
 public:
    CPU_SearchByUin(unsigned long nUin);
+protected:
+   unsigned long m_nMetaCommand;
 };
 
 
diff -urN licq/src/icqd-srv.cpp licq-sk8/src/icqd-srv.cpp
--- licq/src/icqd-srv.cpp       Mon Jan 28 11:22:29 2002
+++ licq-sk8/src/icqd-srv.cpp   Fri Feb 15 10:29:15 2002
@@ -200,6 +200,17 @@
     return e->EventId();
 }
 
+//-----icqSearchByUin-----------------------------------------------------------
+unsigned long CICQDaemon::icqSearchByUin(unsigned long nUin)
+{
+  CPU_SearchByUin *p = new CPU_SearchByUin(nUin);
+  gLog.Info("%sStarting search by uin for user (#%ld/#%d)...\n", L_SRVxSTR,
+            p->Sequence(), p->SubSequence());
+  ICQEvent *e = SendExpectEvent_Server(0, p, NULL);
+  PushExtendedEvent(e);
+  return e->EventId();
+}
+
 //-----icqSearchByInfo-----------------------------------------------------------
 unsigned long CICQDaemon::icqSearchByInfo(const char *nick, const char *first,
                                           const char *last, const char *email)
diff -urN licq/src/icqpacket.cpp licq-sk8/src/icqpacket.cpp
--- licq/src/icqpacket.cpp      Mon Jan 28 11:22:29 2002
+++ licq-sk8/src/icqpacket.cpp  Fri Feb 15 10:29:20 2002
@@ -1149,17 +1149,25 @@
   buffer->Pack(szEmail, nLenEmail);
 }
 
+
 //-----SearchByUin--------------------------------------------------------------
 CPU_SearchByUin::CPU_SearchByUin(unsigned long nUin)
-  : CPacketUdp(ICQ_CMDxSND_SEARCHxUIN)
+  : CPU_CommonFamily(ICQ_SNACxFAM_VARIOUS, ICQ_SNACxSEARCH)
 {
+  m_nMetaCommand = 0x1F05;
 
-  m_nSize += 6;
+  int packetSize = 2+2+2+4+2+2+2+4;
+  m_nSize += packetSize;
   InitBuffer();
 
-#if ICQ_VERSION == 2
-  buffer->PackUnsignedShort(m_nSubSequence);
-#endif
+  buffer->PackUnsignedShortBE(1);
+  buffer->PackUnsignedShortBE(packetSize-2-2); // TLV 1
+
+  buffer->PackUnsignedShort(packetSize-2-2-2); // bytes remaining
+  buffer->PackUnsignedLong(gUserManager.OwnerUin());
+  buffer->PackUnsignedShortBE(0xD007); // type
+  buffer->PackUnsignedShortBE(m_nSubSequence);
+  buffer->PackUnsignedShortBE(0x1F05); // subtype
   buffer->PackUnsignedLong(nUin);
 }
 

Reply via email to