if(argc > 5)
{
for(i = 5; i < argc; i += 2)
- transferaddarg(transfer, argv[i], argv[i + 1]);
+ {
+ if(!wcscmp(argv[i], L"hash"))
+ {
+ transfer->hash = parsehash(argv[i + 1]);
+ } else {
+ transferaddarg(transfer, argv[i], argv[i + 1]);
+ }
+ }
}
sq(sk, 0, L"200", L"%%i", transfer->id, L"Download queued", NULL);
transfersetactivity(transfer, L"create");
(pt->peernick == NULL)?L"":(pt->peernick),
(pt->path == NULL)?L"":(pt->path),
L"%%i", pt->size, L"%%i", pt->curpos,
+ (pt->hash == NULL)?L"":unparsehash(pt->hash),
NULL);
pt = transfer;
}
(pt->peernick == NULL)?L"":(pt->peernick),
(pt->path == NULL)?L"":(pt->path),
L"%%i", pt->size, L"%%i", pt->curpos,
+ (pt->hash == NULL)?L"":unparsehash(pt->hash),
NULL);
}
static int srchres(struct search *srch, struct srchres *sr, void *uudata)
{
struct uidata *data;
- wchar_t *hbuf;
for(data = actives; data != NULL; data = data->next)
{
if(haspriv(data, PERM_SRCH) && data->notify.b.srch && !wcscmp(srch->owner, data->username))
{
- hbuf = NULL;
- if(sr->hash != NULL)
- hbuf = unparsehash(sr->hash);
newnotif(data, 622, NOTIF_ID, srch->id, NOTIF_STR, sr->filename, NOTIF_STR, sr->fnet->name, NOTIF_STR, sr->peerid, NOTIF_INT, sr->size,
- NOTIF_INT, sr->slots, NOTIF_INT, (sr->fn == NULL)?-1:(sr->fn->id), NOTIF_FLOAT, sr->time, NOTIF_STR, (hbuf == NULL)?L"":hbuf, NOTIF_END);
- if(hbuf != NULL)
- free(hbuf);
+ NOTIF_INT, sr->slots, NOTIF_INT, (sr->fn == NULL)?-1:(sr->fn->id), NOTIF_FLOAT, sr->time, NOTIF_STR, (sr->hash == NULL)?L"":unparsehash(sr->hash), NOTIF_END);
}
}
return(0);