diff --git a/pkg/controller/photo/edit_delete.go b/pkg/controller/photo/edit_delete.go index f0d9baf..557e8ef 100644 --- a/pkg/controller/photo/edit_delete.go +++ b/pkg/controller/photo/edit_delete.go @@ -59,8 +59,9 @@ func Edit() http.HandlerFunc { setProfilePic = r.FormValue("intent") == "profile-pic" crop = pphoto.ParseCropCoords(r.FormValue("crop")) - // Are we GOING private? + // Are we GOING private or changing to Inner Circle? goingPrivate = visibility == models.PhotoPrivate && visibility != photo.Visibility + goingCircle = visibility == models.PhotoInnerCircle && visibility != photo.Visibility ) photo.Caption = caption @@ -113,8 +114,8 @@ func Edit() http.HandlerFunc { session.Flash(w, r, "Photo settings updated!") // If this picture has moved to Private, revoke any notification we gave about it before. - if goingPrivate { - log.Info("The picture is GOING PRIVATE, revoke any notifications about it") + if goingPrivate || goingCircle { + log.Info("The picture is GOING PRIVATE (to %s), revoke any notifications about it", photo.Visibility) models.RemoveNotification("photos", photo.ID) } diff --git a/pkg/worker/barertc.go b/pkg/worker/barertc.go index b165502..03bb08d 100644 --- a/pkg/worker/barertc.go +++ b/pkg/worker/barertc.go @@ -14,7 +14,7 @@ import ( // ChatStatistics is the json result of the BareRTC /api/statistics endpoint. type ChatStatistics struct { UserCount int - Usernames []string + Usernames []string `json:",omitempty"` Cameras struct { Blue int Red int @@ -41,6 +41,14 @@ func SetChatStatistics(stats *ChatStatistics) { cachedChatStatistics = stats } +// Privatized returns a copy of ChatStatistics with the usernames list scrubbed. +func (cs ChatStatistics) Privatized() ChatStatistics { + return ChatStatistics{ + UserCount: cs.UserCount, + Cameras: cs.Cameras, + } +} + // IsOnline returns whether the username is currently logged-in to chat. func (cs ChatStatistics) IsOnline(username string) bool { for _, user := range cs.Usernames { diff --git a/web/templates/chat.html b/web/templates/chat.html index 9b5fba9..f389a50 100644 --- a/web/templates/chat.html +++ b/web/templates/chat.html @@ -44,8 +44,6 @@