Skip to content

Commit

Permalink
Merge pull request #2374 from nextcloud/fix/activity
Browse files Browse the repository at this point in the history
fix small issues in relation to activities
  • Loading branch information
dartcafe committed Apr 13, 2022
2 parents 7575707 + 36dc4e6 commit c792f18
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/Service/ActivityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ public function publishActivityEvent(ActivityEvent $activityEvent, string $userI

public function getActivityMessage(ActivityEvent $event, string $language, bool $filtered = false) : string {
$this->l10n = $this->transFactory->get($event->getApp(), $language);
$this->userIsActor = $event->getAuthor() === $this->userSession->getUser()->getUID();
try {
$this->userIsActor = $event->getAuthor() === $this->userSession->getUser()->getUID();
} catch (\Exception $e) {
$this->userIsActor = false;
}
$this->eventType = $event->getType();
$parameters = $event->getSubjectParameters();
$this->shareType = $parameters['shareType']['name'] ?? '';
Expand Down
3 changes: 2 additions & 1 deletion src/js/components/Activity/ActivityItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import moment from '@nextcloud/moment'
import RichText from '@juliushaertl/vue-richtext'
import { UserBubble } from '@nextcloud/vue'
import SimpleLink from '../../helpers/SimpleLink'
import GuestBubble from '../../helpers/GuestBubble'
export default {
name: 'ActivityItem',
Expand Down Expand Up @@ -85,7 +86,7 @@ export default {
break
case 'guest':
parameters[key] = {
component: UserBubble,
component: GuestBubble,
props: {
user: parameters[key].id,
displayName: parameters[key].name,
Expand Down
43 changes: 43 additions & 0 deletions src/js/helpers/GuestBubble.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* @copyright Copyright (c) 2022 Rene Gieling <github@dartcafe.de>
*
* @author Rene Gieling <github@dartcafe.de>
*
* @license AGPL-3.0-or-later
*
* 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 GuestBubble = {
name: 'GuestBubble',
functional: true,

props: {
user: {
type: String,
default: '',
},
displayName: {
type: String,
default: '',
},
},

render(createElement, context) {
return createElement('span', context.props.displayName)
},
}

export default GuestBubble

0 comments on commit c792f18

Please sign in to comment.