]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add server host in notification account field
authorChocobozzz <me@florianbigard.com>
Mon, 21 Jan 2019 12:52:46 +0000 (13:52 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 21 Jan 2019 12:52:46 +0000 (13:52 +0100)
client/src/app/app.component.html
client/src/app/shared/users/user-notification.model.ts
server/models/account/user-notification.ts
shared/models/users/user-notification.model.ts
shared/utils/users/user-notifications.ts

index dfda556f5bbaea714cd033132c1b7aa3d6ef173f..d398d4f351a61574138a0bc28e32ba6d47a3aff8 100644 (file)
@@ -30,7 +30,7 @@
 
       <footer class="row">
         <a href="https://joinpeertube.org" title="PeerTube website" target="_blank" rel="noopener noreferrer">PeerTube v{{ serverVersion }}{{ serverCommit }}</a>&nbsp;-&nbsp;
-        <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" title="PeerTube license" target="_blank" rel="noopener noreferrer">CopyLeft 2015-2018</a>
+        <a href="https://github.com/Chocobozzz/PeerTube/blob/develop/LICENSE" title="PeerTube license" target="_blank" rel="noopener noreferrer">CopyLeft 2015-2019</a>
       </footer>
     </div>
   </div>
index c5996a8a1da571c3f35aa47f232d9891fb37da43..3bb53ff45eea73173f044c7d17f75cc4f2a84af3 100644 (file)
@@ -136,8 +136,8 @@ export class UserNotification implements UserNotificationServer {
     return '/videos/watch/' + video.uuid
   }
 
-  private buildAccountUrl (account: { name: string }) {
-    return '/accounts/' + account.name
+  private buildAccountUrl (account: { name: string, host: string }) {
+    return '/accounts/' + Actor.CREATE_BY_STRING(account.name, account.host)
   }
 
   private buildVideoImportUrl () {
index 1094eec7883dd76238e0dfe4830b62084ecbc549..6cdbb827bca60f7b6c084280a06d794ecd02b7fe 100644 (file)
@@ -28,6 +28,7 @@ import { VideoImportModel } from '../video/video-import'
 import { ActorModel } from '../activitypub/actor'
 import { ActorFollowModel } from '../activitypub/actor-follow'
 import { AvatarModel } from '../avatar/avatar'
+import { ServerModel } from '../server/server'
 
 enum ScopeNames {
   WITH_ALL = 'WITH_ALL'
@@ -43,6 +44,11 @@ function buildActorWithAvatarInclude () {
         attributes: [ 'filename' ],
         model: () => AvatarModel.unscoped(),
         required: false
+      },
+      {
+        attributes: [ 'host' ],
+        model: () => ServerModel.unscoped(),
+        required: false
       }
     ]
   }
@@ -132,6 +138,11 @@ function buildAccountInclude (required: boolean, withActor = false) {
                 attributes: [ 'filename' ],
                 model: () => AvatarModel.unscoped(),
                 required: false
+              },
+              {
+                attributes: [ 'host' ],
+                model: () => ServerModel.unscoped(),
+                required: false
               }
             ]
           },
@@ -411,7 +422,8 @@ export class UserNotificationModel extends Model<UserNotificationModel> {
         id: this.ActorFollow.ActorFollower.Account.id,
         displayName: this.ActorFollow.ActorFollower.Account.getDisplayName(),
         name: this.ActorFollow.ActorFollower.preferredUsername,
-        avatar: this.ActorFollow.ActorFollower.Avatar ? { path: this.ActorFollow.ActorFollower.Avatar.getWebserverPath() } : undefined
+        avatar: this.ActorFollow.ActorFollower.Avatar ? { path: this.ActorFollow.ActorFollower.Avatar.getWebserverPath() } : undefined,
+        host: this.ActorFollow.ActorFollower.getHost()
       },
       following: {
         type: this.ActorFollow.ActorFollowing.VideoChannel ? 'channel' as 'channel' : 'account' as 'account',
@@ -453,6 +465,7 @@ export class UserNotificationModel extends Model<UserNotificationModel> {
       id: accountOrChannel.id,
       displayName: accountOrChannel.getDisplayName(),
       name: accountOrChannel.Actor.preferredUsername,
+      host: accountOrChannel.Actor.getHost(),
       avatar
     }
   }
index eaeb422dfb70115a0886850a7122031f204a480b..186b62612b1a27619da3b6ba90ca6ea96b994812 100644 (file)
@@ -26,6 +26,7 @@ export interface ActorInfo {
   id: number
   displayName: string
   name: string
+  host: string
   avatar?: {
     path: string
   }
index bcbe29fc7d1e58b5e1a226a67b962ef6f294aa4f..b85d5d2f19f6dc629960babef51171c0f91407ea 100644 (file)
@@ -146,6 +146,7 @@ function checkVideo (video: any, videoName?: string, videoUUID?: string) {
 function checkActor (actor: any) {
   expect(actor.displayName).to.be.a('string')
   expect(actor.displayName).to.not.be.empty
+  expect(actor.host).to.not.be.undefined
 }
 
 function checkComment (comment: any, commentId: number, threadId: number) {