X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=daemon%2Fui.c;h=9be2c75e6c1010fecec04facc4b476e9e70a9dd0;hb=378f34d2ec72cfdbf02613b40062648b8dac6b6c;hp=0302fa1a3af5ff0dac76281bd3df35cd7ebe40d1;hpb=d3372da97568d5e1f35fa19787c8ec8af93a0435;p=doldaconnect.git diff --git a/daemon/ui.c b/daemon/ui.c index 0302fa1..9be2c75 100644 --- a/daemon/ui.c +++ b/daemon/ui.c @@ -739,7 +739,14 @@ static void cmd_download(struct socket *sk, struct uidata *data, int argc, wchar if(argc > 5) { for(i = 5; i < argc; i += 2) - transferaddarg(transfer, argv[i], argv[i + 1]); + { + if(!wcscmp(argv[i], L"hash")) + { + transfersethash(transfer, 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"); @@ -761,6 +768,7 @@ static void cmd_lstrans(struct socket *sk, struct uidata *data, int argc, wchar_ (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; } @@ -773,6 +781,7 @@ static void cmd_lstrans(struct socket *sk, struct uidata *data, int argc, wchar_ (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); } @@ -987,7 +996,7 @@ static void cmd_lssr(struct socket *sk, struct uidata *data, int argc, wchar_t * for(sr = srch->results; sr != NULL; sr = sr->next) { swprintf(buf, 64, L"%f", sr->time); - sq(sk, (sr->next != NULL)?1:0, L"200", L"%%ls", sr->filename, sr->fnet->name, L"%%ls", sr->peerid, L"%%i", sr->size, L"%%i", sr->slots, L"%%i", (sr->fn == NULL)?-1:(sr->fn->id), buf, NULL); + sq(sk, (sr->next != NULL)?1:0, L"200", L"%%ls", sr->filename, sr->fnet->name, L"%%ls", sr->peerid, L"%%i", sr->size, L"%%i", sr->slots, L"%%i", (sr->fn == NULL)?-1:(sr->fn->id), buf, L"%%ls", (sr->hash == NULL)?L"":unparsehash(sr->hash), NULL); } } } @@ -1663,7 +1672,10 @@ static int srchres(struct search *srch, struct srchres *sr, void *uudata) for(data = actives; data != NULL; data = data->next) { if(haspriv(data, PERM_SRCH) && data->notify.b.srch && !wcscmp(srch->owner, data->username)) - 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_END); + { + 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, (sr->hash == NULL)?L"":unparsehash(sr->hash), NOTIF_END); + } } return(0); } @@ -1775,6 +1787,12 @@ static int transferchattr(struct transfer *transfer, wchar_t *attrib, void *uuda if(haspriv(data, PERM_TRANS) && data->notify.b.tract && ((transfer->owner == 0) || (transfer->owner == data->uid))) newnotif(data, 616, NOTIF_ID, transfer->id, NOTIF_STR, transfer->path, NOTIF_END); } + } else if(!wcscmp(attrib, L"hash")) { + for(data = actives; data != NULL; data = data->next) + { + if(haspriv(data, PERM_TRANS) && data->notify.b.tract && ((transfer->owner == 0) || (transfer->owner == data->uid))) + newnotif(data, 618, NOTIF_ID, transfer->id, NOTIF_STR, (transfer->hash == NULL)?L"":unparsehash(transfer->hash), NOTIF_END); + } } return(0); }