Last active
June 9, 2016 10:49
-
-
Save slorber/6dcacce7dc659d61cc17219b6c6a1c3f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return the users that should receive a push after a Stample gets moved from one place to the other | |
* @param movedStample the Stample that just got moved | |
* @param movedBy the user that performed the move operation | |
* @param from the former library/folder in which the folder was | |
* @return the list of users to send a push message to | |
*/ | |
private def getUsersReceivingStampleMovePush(movedStample: Stample,movedBy: User,from: FolderLike): List[User] = { | |
val formerLibrary = libraryService.getLibrary(from) | |
val newLibrary = libraryService.getLibrary(movedStample) | |
// If the stample is moved inside same library, we don't send any push | |
if ( formerLibrary == newLibrary ) { | |
Nil | |
} | |
else { | |
libraryService.getLibraryMembers(library) | |
.filterNot(_ == movedBy) // never send a push to the user performing the operation | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment