Skip to content

Commit 37c0497

Browse files
Merge pull request #2658 from MahtabBukhari/Update_Bounty_Assignment_Notificaiton_to_include_link_to_Bounty
Update Bounty Assignment Notificaiton to include link to Bounty
2 parents 02b6b5f + dd47183 commit 37c0497

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

Diff for: handlers/bounty.go

+23-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ func (h *bountyHandler) CreateOrEditBounty(w http.ResponseWriter, r *http.Reques
583583
}
584584

585585
if bounty.Assignee != "" {
586-
msg := fmt.Sprintf("You have been assigned a new ticket: %s.", bounty.Title)
586+
msg := fmt.Sprintf("You have been assigned a new ticket: %s. https://community.sphinx.chat/bounty/%d", bounty.Title, bounty.ID)
587587
assigneePubkey := bounty.Assignee
588588
if bounty.ID != 0 {
589589
if existingBounty.Assignee != "" && existingBounty.Assignee == bounty.Assignee {
@@ -2108,6 +2108,28 @@ func (h *bountyHandler) AddProofOfWork(w http.ResponseWriter, r *http.Request) {
21082108
return
21092109
}
21102110

2111+
bounties, err := h.db.GetBountyById(bountyID)
2112+
if err != nil {
2113+
w.WriteHeader(http.StatusBadRequest)
2114+
logger.Log.Error("[bounty] Error: %v", err)
2115+
} else {
2116+
var bountyResponse []db.BountyResponse = h.GenerateBountyResponse(bounties)
2117+
2118+
ownerPubKey := bountyResponse[0].Owner.OwnerPubKey
2119+
ownerAlias := bountyResponse[0].Owner.OwnerAlias
2120+
ownerRouteHint := bountyResponse[0].Owner.OwnerRouteHint
2121+
assineeAlias := bountyResponse[0].Assignee.OwnerAlias
2122+
bountyTitle := bountyResponse[0].Bounty.Title
2123+
bountyId := bountyResponse[0].Bounty.ID
2124+
2125+
msg := fmt.Sprintf("%s has submitted PoW on Bounty https://community.sphinx.chat/bounty/%d. %s", assineeAlias, bountyId, bountyTitle)
2126+
2127+
if ownerPubKey != "" {
2128+
processNotification(ownerPubKey, "bounty_assigned", msg, ownerAlias, ownerRouteHint)
2129+
}
2130+
2131+
}
2132+
21112133
w.WriteHeader(http.StatusCreated)
21122134
json.NewEncoder(w).Encode(proof)
21132135
}

0 commit comments

Comments
 (0)