Return hashes in SR notifs.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 16 Oct 2005 03:09:25 +0000 (03:09 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Sun, 16 Oct 2005 03:09:25 +0000 (03:09 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@374 959494ce-11ee-0310-bf91-de5d638817bd

daemon/ui.c

index 0302fa1..e77a4ef 100644 (file)
@@ -1659,11 +1659,20 @@ static int srchcommit(struct search *srch, void *uudata)
 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))
-           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);
+       {
+           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);
+       }
     }
     return(0);
 }