| 501 | |
| 502 | |
| 503 | void CSearchList::ProcessSharedFileList(const uint8_t* in_packet, uint32 size, |
| 504 | CUpDownClient* sender, bool *moreResultsAvailable, const wxString& directory) |
| 505 | { |
| 506 | wxCHECK_RET(sender, "No sender in search-results from client."); |
| 507 | |
| 508 | wxUIntPtr searchID = reinterpret_cast<wxUIntPtr>(sender); |
| 509 | |
| 510 | #ifndef AMULE_DAEMON |
| 511 | if (!theApp->amuledlg->m_searchwnd->CheckTabNameExists(sender->GetUserName())) { |
| 512 | theApp->amuledlg->m_searchwnd->CreateNewTab(sender->GetUserName() + " (0)", searchID); |
| 513 | } |
| 514 | #endif |
| 515 | |
| 516 | const CMemFile packet(in_packet, size); |
| 517 | uint32 results = packet.ReadUInt32(); |
| 518 | bool unicoded = (sender->GetUnicodeSupport() != utf8strNone); |
| 519 | for (unsigned int i = 0; i != results; ++i){ |
| 520 | CSearchFile* toadd = new CSearchFile(packet, unicoded, searchID, 0, 0, directory); |
| 521 | toadd->SetClientID(sender->GetUserIDHybrid()); |
| 522 | toadd->SetClientPort(sender->GetUserPort()); |
| 523 | AddToList(toadd, true); |
| 524 | } |
| 525 | |
| 526 | if (moreResultsAvailable) |
| 527 | *moreResultsAvailable = false; |
| 528 | |
| 529 | int iAddData = (int)(packet.GetLength() - packet.GetPosition()); |
| 530 | if (iAddData == 1) { |
| 531 | uint8 ucMore = packet.ReadUInt8(); |
| 532 | if (ucMore == 0x00 || ucMore == 0x01){ |
| 533 | if (moreResultsAvailable) { |
| 534 | *moreResultsAvailable = (ucMore == 1); |
| 535 | } |
| 536 | } |
| 537 | } |
| 538 | } |
| 539 | |
| 540 | |
| 541 | void CSearchList::ProcessSearchAnswer(const uint8_t* in_packet, uint32_t size, bool optUTF8, uint32_t serverIP, uint16_t serverPort) |
nothing calls this directly
no test coverage detected