|
20 | 20 | <div class="media-body font-weight-light small">
|
21 | 21 | <div v-if="n.type == 'favourite'">
|
22 | 22 | <p class="my-0">
|
23 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> liked your |
| 23 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> liked your |
24 | 24 | <span v-if="n.status.hasOwnProperty('media_attachments')">
|
25 |
| - <a class="font-weight-bold" v-bind:href="n.status.url" :id="'fvn-' + n.id">post</a>. |
| 25 | + <a class="font-weight-bold" v-bind:href="getPostUrl(n.status)" :id="'fvn-' + n.id">post</a>. |
26 | 26 | <b-popover :target="'fvn-' + n.id" title="" triggers="hover" placement="top" boundary="window">
|
27 | 27 | <img :src="notificationPreview(n)" width="100px" height="100px" style="object-fit: cover;">
|
28 | 28 | </b-popover>
|
29 | 29 | </span>
|
30 | 30 | <span v-else>
|
31 |
| - <a class="font-weight-bold" v-bind:href="n.status.url">post</a>. |
| 31 | + <a class="font-weight-bold" v-bind:href="getPostUrl(n.status)">post</a>. |
32 | 32 | </span>
|
33 | 33 | </p>
|
34 | 34 | </div>
|
35 | 35 | <div v-else-if="n.type == 'comment'">
|
36 | 36 | <p class="my-0">
|
37 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> commented on your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>. |
| 37 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> commented on your <a class="font-weight-bold" v-bind:href="getPostUrl(n.status)">post</a>. |
38 | 38 | </p>
|
39 | 39 | </div>
|
40 | 40 | <div v-else-if="n.type == 'mention'">
|
41 | 41 | <p class="my-0">
|
42 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> <a class="font-weight-bold" v-bind:href="mentionUrl(n.status)">mentioned</a> you. |
| 42 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> <a class="font-weight-bold" v-bind:href="mentionUrl(n.status)">mentioned</a> you. |
43 | 43 | </p>
|
44 | 44 | </div>
|
45 | 45 | <div v-else-if="n.type == 'follow'">
|
46 | 46 | <p class="my-0">
|
47 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> followed you. |
| 47 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> followed you. |
48 | 48 | </p>
|
49 | 49 | </div>
|
50 | 50 | <div v-else-if="n.type == 'share'">
|
51 | 51 | <p class="my-0">
|
52 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> shared your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>. |
| 52 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> shared your <a class="font-weight-bold" v-bind:href="getPostUrl(n.status)">post</a>. |
53 | 53 | </p>
|
54 | 54 | </div>
|
55 | 55 | <div v-else-if="n.type == 'modlog'">
|
56 | 56 | <p class="my-0">
|
57 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> updated a <a class="font-weight-bold" v-bind:href="n.modlog.url">modlog</a>. |
| 57 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> updated a <a class="font-weight-bold" v-bind:href="n.modlog.url">modlog</a>. |
58 | 58 | </p>
|
59 | 59 | </div>
|
60 | 60 | <div v-else-if="n.type == 'tagged'">
|
61 | 61 | <p class="my-0">
|
62 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> tagged you in a <a class="font-weight-bold" v-bind:href="n.tagged.post_url">post</a>. |
| 62 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> tagged you in a <a class="font-weight-bold" v-bind:href="n.tagged.post_url">post</a>. |
63 | 63 | </p>
|
64 | 64 | </div>
|
65 | 65 | <div v-else-if="n.type == 'direct'">
|
66 | 66 | <p class="my-0">
|
67 |
| - <a :href="n.account.url" class="font-weight-bold text-dark word-break" :title="n.account.username">{{truncate(n.account.username)}}</a> sent a <a class="font-weight-bold" v-bind:href="'/account/direct/t/'+n.account.id">dm</a>. |
| 67 | + <a :href="getProfileUrl(n.account)" class="font-weight-bold text-dark word-break" :title="n.account.username">{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}}</a> sent a <a class="font-weight-bold" v-bind:href="'/account/direct/t/'+n.account.id">dm</a>. |
68 | 68 | </p>
|
69 | 69 | </div>
|
70 | 70 | <div v-else>
|
|
256 | 256 | return '/storage/no-preview.png';
|
257 | 257 | }
|
258 | 258 | return n.status.media_attachments[0].preview_url;
|
| 259 | + }, |
| 260 | +
|
| 261 | + getProfileUrl(account) { |
| 262 | + if(account.local == true) { |
| 263 | + return account.url; |
| 264 | + } |
| 265 | +
|
| 266 | + return '/i/web/profile/_/' + account.id; |
| 267 | + }, |
| 268 | +
|
| 269 | + getPostUrl(status) { |
| 270 | + if(status.local == true) { |
| 271 | + return status.url; |
| 272 | + } |
| 273 | +
|
| 274 | + return '/i/web/post/_/' + status.account.id + '/' + status.id; |
259 | 275 | }
|
260 | 276 | }
|
261 | 277 | }
|
|
0 commit comments