Browse Source
			
			
			Merge pull request #3993 from nextcloud/feature/noid/status
			
				
		Merge pull request #3993 from nextcloud/feature/noid/status
	
		
	
			
				💬 Status adaption for Nextcloud 20
			
			
				pull/3995/head
			
			
		
							committed by
							
								
								GitHub
							
						
					
				
				
				  
				  No known key found for this signature in database
				  
				  	
						GPG Key ID: 4AEE18F83AFDEB23
				  	
				  
				
			
		
		
		
	
				 13 changed files with 191 additions and 18 deletions
			
			
		- 
					4css/At.scss
 - 
					4docs/chat.md
 - 
					8docs/participant.md
 - 
					38lib/Controller/ChatController.php
 - 
					28lib/Controller/RoomController.php
 - 
					12src/components/NewMessageForm/AdvancedInput/AdvancedInput.vue
 - 
					12src/components/RightSidebar/Participants/CurrentParticipants/CurrentParticipants.vue
 - 
					33src/components/RightSidebar/Participants/ParticipantsList/Participant/Participant.vue
 - 
					56src/mixins/userStatus.js
 - 
					1src/services/mentionsService.js
 - 
					3src/services/participantsService.js
 - 
					5tests/php/Controller/ChatControllerTest.php
 - 
					5tests/php/Controller/RoomControllerTest.php
 
@ -0,0 +1,56 @@ | 
				
			|||
/** | 
				
			|||
 * @copyright Copyright (c) 2020 Marco Ambrosini <marcoambrosini@pm.me> | 
				
			|||
 * | 
				
			|||
 * @author Marco Ambrosini <marcoambrosini@pm.me> | 
				
			|||
 * | 
				
			|||
 * @license GNU AGPL version 3 or any later version | 
				
			|||
 * | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU Affero General Public License as | 
				
			|||
 * published by the Free Software Foundation, either version 3 of the | 
				
			|||
 * License, or (at your option) any later version. | 
				
			|||
 * | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 
				
			|||
 * GNU Affero General Public License for more details. | 
				
			|||
 * | 
				
			|||
 * You should have received a copy of the GNU Affero General Public License | 
				
			|||
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 * | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
const userStatus = { | 
				
			|||
	methods: { | 
				
			|||
		getStatusMessage(userData) { | 
				
			|||
			if (!this.isNotAvailable(userData)) { | 
				
			|||
				return '' | 
				
			|||
			} | 
				
			|||
 | 
				
			|||
			let status = '' | 
				
			|||
			if (userData.statusIcon) { | 
				
			|||
				status = userData.statusIcon + ' ' | 
				
			|||
			} | 
				
			|||
 | 
				
			|||
			if (userData.statusMessage) { | 
				
			|||
				status += userData.statusMessage | 
				
			|||
			} else if (userData.status === 'dnd') { | 
				
			|||
				status += t('spreed', 'Do not disturb') | 
				
			|||
			} else { | 
				
			|||
				status += t('spreed', 'Away') | 
				
			|||
			} | 
				
			|||
 | 
				
			|||
			return status | 
				
			|||
		}, | 
				
			|||
 | 
				
			|||
		isNotAvailable(userData) { | 
				
			|||
			if (!userData.status) { | 
				
			|||
				return false | 
				
			|||
			} | 
				
			|||
 | 
				
			|||
			return userData.status === 'away' || userData.status === 'dnd' | 
				
			|||
		}, | 
				
			|||
	}, | 
				
			|||
} | 
				
			|||
 | 
				
			|||
export default userStatus | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue