Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix small issues in relation to activities #2374

Merged
merged 1 commit into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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