Photo albums make extensive use of the "publicly-appendable collections" FEP.
Albums themselves are sm:PhotoAlbum objects, which are a subtype of Collection. Each album contains sm:Photo objects representing photos. Albums belonging to an actor reside in its sm:photoAlbums collection.
Album object
sm:PhotoAlbum objects have the following fields:
idandurlname– the titlesummary– the descriptiontotalItems– the number of photosattributedTo– the owner IDpublishedandupdated– timestamps when this album was created and when the newest photo was added, respectivelyfirst– the firstCollectionPagecontainingsm:Photossm:displayOrder– the number that determines in which order to display the albums, sort by these in ascending orderpreview– the ID of the photo that's being used as this album's coversm:comments– the ID of the collection containing all the comments on all the photos in this albumsm:systemType– for system albums, eithersm:SavedPhotosorsm:ProfilePicturessm:viewPrivacyandsm:commentPrivacy– user-owned albums only, privacy setting objects for who can see this album and who can comment on the photos it containssm:uploadsRestricted– group-owned albums only, whether only group managers can upload new photos to this albumsm:commentingDisabled– group-owned albums only,trueif commenting on the photos in this album is not allowed
Photo object
sm:Photo objects have the following fields:
idandurlattributedTo– for user-owned photos, matches the owner; for group-owned photos, specifies the user who uploaded this phototarget– the abbreviated collection object (as per FEP-400e) for the photo albumsummary– the descriptionpublished– the timestamp when this photo was uploadedsm:displayOrder– an integer to sort photos within the album by, similar to the same field in album objectsreplies– the collection of comments on this photolikes– the collection of likes of this photoimage– theImagerepresenting the phototag– containssm:TaggedPersonobjects representing tags, if any, see below
Album-related activities
Creating, updating, or deleting and album is done by the owner sending a Create{sm:PhotoAlbum}, Update{sm:PhotoAlbum}, or Delete{sm:PhotoAlbum} activity, respectively, to its followers, or the subset of followers matching the album's "who can view" privacy setting, whichever is smaller. In case the album's "who can view" privacy setting changes such that fewer or different people can see the album now, the Update activity is sent to both the new and the old audiences, so that the servers of people who no longer have access to the album know to hide it from those users.
It is currently not possible to remotely create albums in groups, thus only group managers can create those (group managers are required to be on the same server as the group itself).
Photo-related activities
Photos work largely the same as wall posts, except the collection they belong to is the album instead of an actor's sm:wall.
- Adding a photo works by the owner sending an
Add{sm:Photo}activity.- The activity is sent to the owner's followers, or whoever can see the album, whichever set is smaller.
- To add a photo to an album in a group, a user sends a
Create{sm:Photo}activity to the group, which thenAdds it to the album.
- Updating a photo (its description, tags, or display order) is done by sending an
Update{sm:Photo}activity.- For user-owned photos, it's the same as for creating a photo.
- For group-owned photos, the activity is sent to the group, which then forwards it to its followers. It's strongly recommended to LD-sign your activity to make this work.
- Deleting a photo:
- If the photo is being deleted by its original uploader, it works the same as updating, but with a
Delete{sm:Photo}activity. - If the photo is in a group and is being deleted by a group manager, a
Remove{sm:Photo}is sent to the followers and the uploader.
- If the photo is being deleted by its original uploader, it works the same as updating, but with a
Comments
See comment federation.
Each album has its own sm:comments collection that contains all comments on all photos.
Tagging
Tags on photos can only be added by the uploader, and, in case of groups, group managers.
A user can only tag themselves or their friends in a photo, and only those that can see the album it's in.
A tag can reference a user actor, or it can just be some freeform label. If it does reference a user, the tag must first be confirmed by that user, unless the user tagged themselves. Unconfirmed tags display the name, but don't link to the profile.
All photos a user is tagged in are available in the sm:taggedPhotos collection, subject to the corresponding privacy setting.
- Adding or removing a tag is done by simply sending an
Update{sm:Photo}with the new tag added to or removed from thetagfield. - Confirming a tag is done by
Adding the photo to thesm:taggedPhotoscollection.- Whether the tag is confirmed can be checked using a collection query.
- After a tag is confirmed, the photo owner sends an
Update{sm:Photo}. - These
Addactivities are also sent to followers, so their servers could create a "%username% was tagged in a photo" newsfeed entry and have an up-to-date list of tagged photos.
- Rejecting a tag is done by sending a
Reject{sm:Photo}to the owner, withsm:taggedPhotosas thetarget. - Removing a previously confirmed tag is done by sending a
Remove{sm:Photo}withtargetset to, again,sm:taggedPhotos.
sm:TaggedPerson (subtype of ActivityPub Link) objects have the following fields:
idname– the name as entered by whoever created the tag, or the name of the tagged userpublished– the timestamp when the tag was createdsm:rect– an array of 4 floats determining the tagged area, in the order [left, top, right, bottom], each from 0 to 1, where 0 is the top left corner and 1 is bottom rightsm:approved– whether the tag was approved by the tagged person. This value can be trusted for users on the same server as the photo, but it's highly recommended to make collection queries to re-check the approval state for tags for users on other serversattributedTo– the ID of the user who created the taghref– if it's a tagged user and the tag was approved by them, the ID of that user
Limits
Smithereen imposes the following limits:
- No more than 70 albums per owner (excluding system albums).
- No more then 5000 photos per album.
- No more than 50 tags per photo.