diff --git a/CHANGELOG.md b/CHANGELOG.md
index 18cf8872..0598aab8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,9 @@
- Add Instagram Import ([e2a6bdd0](https://github.com/pixelfed/pixelfed/commit/e2a6bdd0))
- Add notification preview to NotificationCard ([28445e27](https://github.com/pixelfed/pixelfed/commit/28445e27))
- Add Grid Mode to Timelines ([c1853ca8](https://github.com/pixelfed/pixelfed/commit/c1853ca8))
+- Add MediaPathService ([c54b29c5](https://github.com/pixelfed/pixelfed/commit/c54b29c5))
+- Add Media Tags ([711fc020](https://github.com/pixelfed/pixelfed/commit/711fc020))
+- Add MediaTagService ([524c6d45](https://github.com/pixelfed/pixelfed/commit/524c6d45))
### Updated
- Updated PostComponent, fix remote urls ([42716ccc](https://github.com/pixelfed/pixelfed/commit/42716ccc))
@@ -59,6 +62,13 @@
- Updated Timeline.vue, hide like counts on grid mode. Fixes ([#2293](https://github.com/pixelfed/pixelfed/issues/2293)) ([cc18159f](https://github.com/pixelfed/pixelfed/commit/cc18159f))
- Updated Timeline.vue, make grid mode photos clickable. Fixes ([#2292](https://github.com/pixelfed/pixelfed/issues/2292)) ([6db68184](https://github.com/pixelfed/pixelfed/commit/6db68184))
- Updated ComposeModal.vue, use vue tooltips. Fixes ([#2142](https://github.com/pixelfed/pixelfed/issues/2142)) ([2b753123](https://github.com/pixelfed/pixelfed/commit/2b753123))
+- Updated AccountController, prevent blocking admins. ([2c440b48](https://github.com/pixelfed/pixelfed/commit/2c440b48))
+- Updated Api controllers to use MediaPathService. ([58864212](https://github.com/pixelfed/pixelfed/commit/58864212))
+- Updated notification components, add modlog and tagged notification types ([51862b8b](https://github.com/pixelfed/pixelfed/commit/51862b8b))
+- Updated StoryController, allow video stories. ([b3b220b9](https://github.com/pixelfed/pixelfed/commit/b3b220b9))
+- Updated InternalApiController, add media tags. ([ee93f459](https://github.com/pixelfed/pixelfed/commit/ee93f459))
+- Updated ComposeModal.vue, add media tagging. ([421ea022](https://github.com/pixelfed/pixelfed/commit/421ea022))
+- Updated NotificationTransformer, add modlog and tagged types. ([49dab6fb](https://github.com/pixelfed/pixelfed/commit/49dab6fb))
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
### Added
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index a1838076..09f4ba1c 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -244,7 +244,7 @@ class AccountController extends Controller
switch ($type) {
case 'user':
$profile = Profile::findOrFail($item);
- if ($profile->id == $user->id) {
+ if ($profile->id == $user->id || $profile->user->is_admin == true) {
return abort(403);
}
$class = get_class($profile);
diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php
index edf89261..dd611283 100644
--- a/app/Http/Controllers/Api/ApiV1Controller.php
+++ b/app/Http/Controllers/Api/ApiV1Controller.php
@@ -47,6 +47,7 @@ use App\Jobs\VideoPipeline\{
};
use App\Services\{
NotificationService,
+ MediaPathService,
SearchApiV2Service
};
@@ -646,6 +647,10 @@ class ApiV1Controller extends Controller
$profile = Profile::findOrFail($id);
+ if($profile->user->is_admin == true) {
+ abort(400, 'You cannot block an admin');
+ }
+
Follower::whereProfileId($profile->id)->whereFollowingId($pid)->delete();
Follower::whereProfileId($pid)->whereFollowingId($profile->id)->delete();
Notification::whereProfileId($pid)->whereActorId($profile->id)->delete();
@@ -1030,9 +1035,6 @@ class ApiV1Controller extends Controller
$filterClass = in_array($request->input('filter_class'), Filter::classes()) ? $request->input('filter_class') : null;
$filterName = in_array($request->input('filter_name'), Filter::names()) ? $request->input('filter_name') : null;
- $monthHash = hash('sha1', date('Y').date('m'));
- $userHash = hash('sha1', $user->id . (string) $user->created_at);
-
$photo = $request->file('file');
$mimes = explode(',', config('pixelfed.media_types'));
@@ -1040,7 +1042,7 @@ class ApiV1Controller extends Controller
abort(403, 'Invalid or unsupported mime type.');
}
- $storagePath = "public/m/{$monthHash}/{$userHash}";
+ $storagePath = MediaPathService::get($user, 2);
$path = $photo->store($storagePath);
$hash = \hash_file('sha256', $photo);
@@ -1916,7 +1918,7 @@ class ApiV1Controller extends Controller
foreach($bookmarks as $id) {
$res[] = \App\Services\StatusService::get($id);
}
- return response()->json($res, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
+ return $res;
}
/**
diff --git a/app/Http/Controllers/Api/BaseApiController.php b/app/Http/Controllers/Api/BaseApiController.php
index 6b18f835..433841fb 100644
--- a/app/Http/Controllers/Api/BaseApiController.php
+++ b/app/Http/Controllers/Api/BaseApiController.php
@@ -35,6 +35,7 @@ use App\Jobs\VideoPipeline\{
VideoThumbnail
};
use App\Services\NotificationService;
+use App\Services\MediaPathService;
class BaseApiController extends Controller
{
@@ -235,9 +236,6 @@ class BaseApiController extends Controller
$filterClass = in_array($request->input('filter_class'), Filter::classes()) ? $request->input('filter_class') : null;
$filterName = in_array($request->input('filter_name'), Filter::names()) ? $request->input('filter_name') : null;
- $monthHash = hash('sha1', date('Y').date('m'));
- $userHash = hash('sha1', $user->id . (string) $user->created_at);
-
$photo = $request->file('file');
$mimes = explode(',', config('pixelfed.media_types'));
@@ -245,7 +243,7 @@ class BaseApiController extends Controller
return;
}
- $storagePath = "public/m/{$monthHash}/{$userHash}";
+ $storagePath = MediaPathService::get($user, 2);
$path = $photo->store($storagePath);
$hash = \hash_file('sha256', $photo);
diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php
index 5463c895..76489325 100644
--- a/app/Http/Controllers/InternalApiController.php
+++ b/app/Http/Controllers/InternalApiController.php
@@ -10,6 +10,7 @@ use App\{
Follower,
Like,
Media,
+ MediaTag,
Notification,
Profile,
StatusHashtag,
@@ -30,6 +31,7 @@ use League\Fractal\Serializer\ArraySerializer;
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use Illuminate\Validation\Rule;
use Illuminate\Support\Str;
+use App\Services\MediaTagService;
use App\Services\ModLogService;
use App\Services\PublicTimelineService;
@@ -258,7 +260,8 @@ class InternalApiController extends Controller
'cw' => 'nullable|boolean',
'visibility' => 'required|string|in:public,private,unlisted|min:2|max:10',
'place' => 'nullable',
- 'comments_disabled' => 'nullable'
+ 'comments_disabled' => 'nullable',
+ 'tagged' => 'nullable'
]);
if(config('costar.enabled') == true) {
@@ -282,6 +285,7 @@ class InternalApiController extends Controller
$mimes = [];
$place = $request->input('place');
$cw = $request->input('cw');
+ $tagged = $request->input('tagged');
foreach($medias as $k => $media) {
if($k + 1 > config('pixelfed.max_album_length')) {
@@ -328,6 +332,21 @@ class InternalApiController extends Controller
$media->save();
}
+ foreach($tagged as $tg) {
+ $mt = new MediaTag;
+ $mt->status_id = $status->id;
+ $mt->media_id = $status->media->first()->id;
+ $mt->profile_id = $tg['id'];
+ $mt->tagged_username = $tg['name'];
+ $mt->is_public = true; // (bool) $tg['privacy'] ?? 1;
+ $mt->metadata = json_encode([
+ '_v' => 1,
+ ]);
+ $mt->save();
+ MediaTagService::set($mt->status_id, $mt->profile_id);
+ MediaTagService::sendNotification($mt);
+ }
+
$visibility = $profile->unlisted == true && $visibility == 'public' ? 'unlisted' : $visibility;
$cw = $profile->cw == true ? true : $cw;
$status->is_nsfw = $cw;
diff --git a/app/Http/Controllers/MediaTagController.php b/app/Http/Controllers/MediaTagController.php
new file mode 100644
index 00000000..54d2c262
--- /dev/null
+++ b/app/Http/Controllers/MediaTagController.php
@@ -0,0 +1,55 @@
+user(), 403);
+
+ $this->validate($request, [
+ 'q' => 'required|string|min:1|max:50'
+ ]);
+
+ $q = $request->input('q');
+
+ if(Str::of($q)->startsWith('@')) {
+ if(strlen($q) < 3) {
+ return [];
+ }
+ $q = mb_substr($q, 1);
+ }
+
+ $blocked = UserFilter::whereFilterableType('App\Profile')
+ ->whereFilterType('block')
+ ->whereFilterableId($request->user()->profile_id)
+ ->pluck('user_id');
+
+ $blocked->push($request->user()->profile_id);
+
+ $results = Profile::select('id','domain','username')
+ ->whereNotIn('id', $blocked)
+ ->whereNull('domain')
+ ->where('username','like','%'.$q.'%')
+ ->limit(15)
+ ->get()
+ ->map(function($r) {
+ return [
+ 'id' => (string) $r->id,
+ 'name' => $r->username,
+ 'privacy' => true,
+ 'avatar' => $r->avatarUrl()
+ ];
+ });
+
+ return $results;
+ }
+}
diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php
index cf209bf1..5ec19aa2 100644
--- a/app/Http/Controllers/StatusController.php
+++ b/app/Http/Controllers/StatusController.php
@@ -17,6 +17,7 @@ use Illuminate\Http\Request;
use League\Fractal;
use App\Util\Media\Filter;
use Illuminate\Support\Str;
+use App\Services\HashidService;
class StatusController extends Controller
{
@@ -65,6 +66,16 @@ class StatusController extends Controller
return view($template, compact('user', 'status'));
}
+ public function shortcodeRedirect(Request $request, $id)
+ {
+ if(strlen($id) < 5 || !Auth::check()) {
+ return redirect('/login?next='.urlencode('/' . $request->path()));
+ }
+ $id = HashidService::decode($id);
+ $status = Status::findOrFail($id);
+ return redirect($status->url());
+ }
+
public function showId(int $id)
{
abort(404);
diff --git a/app/Http/Controllers/StoryController.php b/app/Http/Controllers/StoryController.php
index 1e59fba2..acbd3f51 100644
--- a/app/Http/Controllers/StoryController.php
+++ b/app/Http/Controllers/StoryController.php
@@ -24,7 +24,7 @@ class StoryController extends Controller
'file' => function() {
return [
'required',
- 'mimes:image/jpeg,image/png',
+ 'mimes:image/jpeg,image/png,video/mp4',
'max:' . config('pixelfed.max_photo_size'),
];
},
@@ -42,7 +42,7 @@ class StoryController extends Controller
$story = new Story();
$story->duration = 3;
$story->profile_id = $user->profile_id;
- $story->type = 'photo';
+ $story->type = Str::endsWith($photo->getMimeType(), 'mp4') ? 'video' :'photo';
$story->mime = $photo->getMimeType();
$story->path = $path;
$story->local = true;
@@ -65,7 +65,8 @@ class StoryController extends Controller
$mimes = explode(',', config('pixelfed.media_types'));
if(in_array($photo->getMimeType(), [
'image/jpeg',
- 'image/png'
+ 'image/png',
+ 'video/mp4'
]) == false) {
abort(400, 'Invalid media type');
return;
@@ -73,11 +74,13 @@ class StoryController extends Controller
$storagePath = "public/_esm.t2/{$monthHash}/{$sid}/{$rid}";
$path = $photo->store($storagePath);
- $fpath = storage_path('app/' . $path);
- $img = Intervention::make($fpath);
- $img->orientate();
- $img->save($fpath, config('pixelfed.image_quality'));
- $img->destroy();
+ if(in_array($photo->getMimeType(), ['image/jpeg','image/png',])) {
+ $fpath = storage_path('app/' . $path);
+ $img = Intervention::make($fpath);
+ $img->orientate();
+ $img->save($fpath, config('pixelfed.image_quality'));
+ $img->destroy();
+ }
return $path;
}
@@ -164,7 +167,7 @@ class StoryController extends Controller
->map(function($s, $k) {
return [
'id' => (string) $s->id,
- 'type' => 'photo',
+ 'type' => Str::endsWith($s->path, '.mp4') ? 'video' :'photo',
'length' => 3,
'src' => url(Storage::url($s->path)),
'preview' => null,
@@ -198,7 +201,7 @@ class StoryController extends Controller
$res = [
'id' => (string) $story->id,
- 'type' => 'photo',
+ 'type' => Str::endsWith($story->path, '.mp4') ? 'video' :'photo',
'length' => 3,
'src' => url(Storage::url($story->path)),
'preview' => null,
@@ -233,7 +236,7 @@ class StoryController extends Controller
->map(function($s, $k) {
return [
'id' => $s->id,
- 'type' => 'photo',
+ 'type' => Str::endsWith($s->path, '.mp4') ? 'video' :'photo',
'length' => 3,
'src' => url(Storage::url($s->path)),
'preview' => null,
@@ -315,7 +318,7 @@ class StoryController extends Controller
->map(function($s, $k) {
return [
'id' => $s->id,
- 'type' => 'photo',
+ 'type' => Str::endsWith($s->path, '.mp4') ? 'video' :'photo',
'length' => 3,
'src' => url(Storage::url($s->path)),
'preview' => null,
diff --git a/app/MediaTag.php b/app/MediaTag.php
new file mode 100644
index 00000000..ff5fe9b6
--- /dev/null
+++ b/app/MediaTag.php
@@ -0,0 +1,13 @@
+belongsTo(Status::class);
+ }
+}
diff --git a/app/Services/ActivityPubFetchService.php b/app/Services/ActivityPubFetchService.php
index 765c6276..cdfe8143 100644
--- a/app/Services/ActivityPubFetchService.php
+++ b/app/Services/ActivityPubFetchService.php
@@ -14,7 +14,7 @@ class ActivityPubFetchService
public $url;
public $headers = [
'Accept' => 'application/activity+json, application/json',
- 'User-Agent' => 'PixelfedBot - https://pixelfed.org'
+ 'User-Agent' => '(Pixelfed/'.config('pixelfed.version').'; +'.config('app.url').')'
];
public static function queue()
diff --git a/app/Services/HashidService.php b/app/Services/HashidService.php
new file mode 100644
index 00000000..d23c5c52
--- /dev/null
+++ b/app/Services/HashidService.php
@@ -0,0 +1,50 @@
+ PHP_INT_MAX || strlen($id) < self::MIN_LIMIT) {
+ return null;
+ }
+ $key = "hashids:{$id}";
+ return Cache::remember($key, now()->hours(48), function() use($id) {
+ $cmap = self::CMAP;
+ $base = strlen($cmap);
+ $shortcode = '';
+ while($id) {
+ $id = ($id - ($r = $id % $base)) / $base;
+ $shortcode = $cmap{$r} . $shortcode;
+ };
+ return $shortcode;
+ });
+ }
+
+ public static function decode($short)
+ {
+ $len = strlen($short);
+ if($len < 3 || $len > 11) {
+ return null;
+ }
+ $id = 0;
+ foreach(str_split($short) as $needle) {
+ $pos = strpos(self::CMAP, $needle);
+ // if(!$pos) {
+ // return null;
+ // }
+ $id = ($id*64) + $pos;
+ }
+ if(strlen($id) < self::MIN_LIMIT) {
+ return null;
+ }
+ return $id;
+ }
+
+}
\ No newline at end of file
diff --git a/app/Services/MediaPathService.php b/app/Services/MediaPathService.php
new file mode 100644
index 00000000..c8ae1422
--- /dev/null
+++ b/app/Services/MediaPathService.php
@@ -0,0 +1,51 @@
+id . (string) $account->created_at);
+ $path = "public/m/{$monthHash}/{$userHash}";
+ break;
+
+ case 2:
+ $monthHash = substr($mh, 0, 9).'-'.substr($mh, 9, 6);
+ $userHash = $account->profile_id;
+ $random = Str::random(12);
+ $path = "public/m/_v2/{$userHash}/{$monthHash}/{$random}";
+ break;
+
+ default:
+ $monthHash = substr($mh, 0, 9).'-'.substr($mh, 9, 6);
+ $userHash = $account->profile_id;
+ $random = Str::random(12);
+ $path = "public/m/_v2/{$userHash}/{$monthHash}/{$random}";
+ break;
+ }
+ }
+ if($account instanceOf Profile) {
+ $monthHash = substr($mh, 0, 9).'-'.substr($mh, 9, 6);
+ $userHash = $account->id;
+ $random = Str::random(12);
+ $path = "public/m/_v2/{$userHash}/{$monthHash}/{$random}";
+ }
+ return $path;
+ }
+
+}
\ No newline at end of file
diff --git a/app/Services/MediaTagService.php b/app/Services/MediaTagService.php
new file mode 100644
index 00000000..087487d4
--- /dev/null
+++ b/app/Services/MediaTagService.php
@@ -0,0 +1,78 @@
+addMinutes(60), function() use($mediaId, $usernames) {
+ $key = self::CACHE_KEY . $mediaId;
+ if(Redis::zCount($key, '-inf', '+inf') == 0) {
+ return [];
+ }
+ $res = Redis::zRange($key, 0, -1);
+ if(!$usernames) {
+ return $res;
+ }
+ $usernames = [];
+ foreach ($res as $k) {
+ $username = (new self)->idToUsername($k);
+ array_push($usernames, $username);
+ }
+
+ return $usernames;
+ });
+ }
+
+ public static function set($mediaId, $profileId)
+ {
+ $key = self::CACHE_KEY . $mediaId;
+ Redis::zAdd($key, $profileId, $profileId);
+ return true;
+ }
+
+ protected function idToUsername($id)
+ {
+ $profile = ProfileService::build()->profileId($id);
+
+ if(!$profile) {
+ return 'unavailable';
+ }
+
+ return [
+ 'username' => $profile->username,
+ 'avatar' => $profile->avatarUrl()
+ ];
+ }
+
+ public static function sendNotification(MediaTag $tag)
+ {
+ $p = $tag->status->profile;
+ $actor = $p->username;
+ $message = "{$actor} tagged you in a post.";
+ $rendered = "{$actor} tagged you in a post.";
+ $n = new Notification;
+ $n->profile_id = $tag->profile_id;
+ $n->actor_id = $p->id;
+ $n->item_id = $tag->id;
+ $n->item_type = 'App\MediaTag';
+ $n->action = 'tagged';
+ $n->message = $message;
+ $n->rendered = $rendered;
+ $n->save();
+ return;
+ }
+
+}
\ No newline at end of file
diff --git a/app/Transformer/Api/NotificationTransformer.php b/app/Transformer/Api/NotificationTransformer.php
index 7d0d9c5e..812b250e 100644
--- a/app/Transformer/Api/NotificationTransformer.php
+++ b/app/Transformer/Api/NotificationTransformer.php
@@ -14,7 +14,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract
'account',
'status',
'relationship',
- 'modlog'
+ 'modlog',
+ 'tagged'
];
public function transform(Notification $notification)
@@ -55,7 +56,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract
'share' => 'share',
'like' => 'favourite',
'comment' => 'comment',
- 'admin.user.modlog.comment' => 'modlog'
+ 'admin.user.modlog.comment' => 'modlog',
+ 'tagged' => 'tagged'
];
return $verbs[$verb];
}
@@ -85,4 +87,22 @@ class NotificationTransformer extends Fractal\TransformerAbstract
return null;
}
}
+
+
+ public function includeTagged(Notification $notification)
+ {
+ $n = $notification;
+ if($n->item_id && $n->item_type == 'App\MediaTag') {
+ $ml = $n->item;
+ $res = $this->item($ml, function($ml) {
+ return [
+ 'username' => $ml->status->profile->username,
+ 'post_url' => $ml->status->url()
+ ];
+ });
+ return $res;
+ } else {
+ return null;
+ }
+ }
}
diff --git a/app/Transformer/Api/StatusTransformer.php b/app/Transformer/Api/StatusTransformer.php
index 80074e7b..5eca1cca 100644
--- a/app/Transformer/Api/StatusTransformer.php
+++ b/app/Transformer/Api/StatusTransformer.php
@@ -5,6 +5,8 @@ namespace App\Transformer\Api;
use App\Status;
use League\Fractal;
use Cache;
+use App\Services\HashidService;
+use App\Services\MediaTagService;
class StatusTransformer extends Fractal\TransformerAbstract
{
@@ -15,12 +17,15 @@ class StatusTransformer extends Fractal\TransformerAbstract
public function transform(Status $status)
{
+ $taggedPeople = MediaTagService::get($status->id);
+
return [
'id' => (string) $status->id,
+ 'shortcode' => HashidService::encode($status->id),
'uri' => $status->url(),
'url' => $status->url(),
- 'in_reply_to_id' => $status->in_reply_to_id,
- 'in_reply_to_account_id' => $status->in_reply_to_profile_id,
+ 'in_reply_to_id' => (string) $status->in_reply_to_id,
+ 'in_reply_to_account_id' => (string) $status->in_reply_to_profile_id,
'reblog' => null,
'content' => $status->rendered ?? $status->caption,
'content_text' => $status->caption,
@@ -50,6 +55,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
'parent' => [],
'place' => $status->place,
'local' => (bool) $status->local,
+ 'taggedPeople' => $taggedPeople
];
}
diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php
index ef13e7b7..bd5bc95b 100644
--- a/app/Util/ActivityPub/Helpers.php
+++ b/app/Util/ActivityPub/Helpers.php
@@ -24,6 +24,7 @@ use App\Jobs\StatusPipeline\NewStatusPipeline;
use App\Util\ActivityPub\HttpSignature;
use Illuminate\Support\Str;
use App\Services\ActivityPubDeliveryService;
+use App\Services\MediaPathService;
class Helpers {
@@ -355,9 +356,7 @@ class Helpers {
}
$attachments = isset($data['object']) ? $data['object']['attachment'] : $data['attachment'];
$user = $status->profile;
- $monthHash = hash('sha1', date('Y').date('m'));
- $userHash = hash('sha1', $user->id.(string) $user->created_at);
- $storagePath = "public/m/{$monthHash}/{$userHash}";
+ $storagePath = MediaPathService::get($user, 2);
$allowed = explode(',', config('pixelfed.media_types'));
foreach($attachments as $media) {
diff --git a/database/migrations/2020_06_30_180159_create_media_tags_table.php b/database/migrations/2020_06_30_180159_create_media_tags_table.php
new file mode 100644
index 00000000..10b2b721
--- /dev/null
+++ b/database/migrations/2020_06_30_180159_create_media_tags_table.php
@@ -0,0 +1,38 @@
+id();
+ $table->bigInteger('status_id')->unsigned()->index()->nullable();
+ $table->bigInteger('media_id')->unsigned()->index();
+ $table->bigInteger('profile_id')->unsigned()->index();
+ $table->string('tagged_username')->nullable();
+ $table->boolean('is_public')->default(true)->index();
+ $table->json('metadata')->nullable();
+ $table->unique(['media_id', 'profile_id']);
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('media_tags');
+ }
+}
diff --git a/public/js/activity.js b/public/js/activity.js
index ea1f06f2..829344ea 100644
--- a/public/js/activity.js
+++ b/public/js/activity.js
@@ -1 +1 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(t,a,e){t.exports=e("hUgz")},"KHd+":function(t,a,e){"use strict";function n(t,a,e,n,o,i,s,r){var c,l="function"==typeof t?t.options:t;if(a&&(l.render=a,l.staticRenderFns=e,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=r?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,a){return c.call(a),u(t,a)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}e.d(a,"a",(function(){return n}))},hUgz:function(t,a,e){Vue.component("activity-component",e("tXHz").default)},tXHz:function(t,a,e){"use strict";e.r(a);function n(t){return function(t){if(Array.isArray(t)){for(var a=0,e=new Array(t.length);a or
+ {{truncate(n.account.username)}} updated a modlog. +
++ {{truncate(n.account.username)}} tagged you in a post. +
+Tag people NEW
+Add location
@@ -269,9 +269,10 @@
- Visibility: {{visibilityTag}} + Audience - Edit + {{visibilityTag}} +
This feature is not available yet.
+You can tag {{10 - taggedUsernames.length}} more {{taggedUsernames.length == 9 ? 'person' : 'people'}}!
+Tagged People
+ +When you tag someone, they are sent a notification.
For more information on tagging, click here.
Tagging someone is like mentioning them, with the option to make it private between you.
++ You can choose to tag someone in public or private mode. Public mode will allow others to see who you tagged in the post and private mode tagged users will not be shown to others. +
+ {{truncate(n.account.username)}} tagged you in a post. +
++ We cannot display this notification at this time. +
+{{status.place.name}}, {{status.place.country}}
++ + {{status.taggedPeople.length}} Tagged People + + • + {{status.place.name}}, {{status.place.country}} +
More posts from {{this.statusUsername}}
By using this embed, you agree to our Terms of Use
+ + {{user.username}} + +
+Learn more about Tagging People.
+{{profile.display_name}}
-{{profile.acct}}
+{{profile.acct}}
{{profile.statuses_count}} @@ -481,6 +481,18 @@ suffix = suffix ? ' ' + suffix : ''; return App.util.format.timeAgo(ts) + suffix; }, + + urlRedirectHandler(url) { + let p = new URL(url); + let path = ''; + if(p.hostname == window.location.hostname) { + path = url; + } else { + path = '/i/redirect?url='; + path += encodeURI(url); + } + window.location.href = path; + } } } diff --git a/resources/assets/js/components/StoryCompose.vue b/resources/assets/js/components/StoryCompose.vue index c3d7ae45..ffd6ba2d 100644 --- a/resources/assets/js/components/StoryCompose.vue +++ b/resources/assets/js/components/StoryCompose.vue @@ -1,7 +1,7 @@
-
+
@@ -9,12 +9,19 @@
-
+
+
Add Photo
- Edit Story
+ Edit
+
@@ -150,10 +157,12 @@
props: ['profile-id'],
data() {
return {
+ loaded: false,
config: window.App.config,
mimes: [
'image/jpeg',
- 'image/png'
+ 'image/png',
+ // 'video/mp4'
],
page: 'landing',
pages: [
@@ -181,7 +190,10 @@
mounted() {
this.mediaWatcher();
axios.get('/api/stories/v0/fetch/' + this.profileId)
- .then(res => this.stories = res.data);
+ .then(res => {
+ this.stories = res.data;
+ this.loaded = true;
+ });
},
methods: {
diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue
index f92dd471..e62f6e7e 100644
--- a/resources/assets/js/components/Timeline.vue
+++ b/resources/assets/js/components/Timeline.vue
@@ -91,13 +91,14 @@
-
+
+
- -->
+
@@ -107,11 +108,17 @@
-
+
+
+
+ {{status.place.name}}, {{status.place.country}}
+
diff --git a/resources/lang/en/helpcenter.php b/resources/lang/en/helpcenter.php
index 62877d1a..74531d7b 100644
--- a/resources/lang/en/helpcenter.php
+++ b/resources/lang/en/helpcenter.php
@@ -21,6 +21,8 @@ return [
'blockingAccounts' => 'Blocking Accounts',
'safetyTips' => 'Safety Tips',
'reportSomething' => 'Report Something',
- 'dataPolicy' => 'Data Policy'
+ 'dataPolicy' => 'Data Policy',
+
+ 'taggingPeople' => 'Tagging People'
];
\ No newline at end of file
diff --git a/resources/lang/pl/site.php b/resources/lang/pl/site.php
index 4b0b3ea8..826ad5b9 100644
--- a/resources/lang/pl/site.php
+++ b/resources/lang/pl/site.php
@@ -13,7 +13,7 @@ return [
'currentLocale' => 'Obecny język',
'selectLocale' => 'Wybierz jeden z dostępnych języków',
'contact' => 'Kontakt',
- 'contact-us' => 'Skontaktuj się z naim',
+ 'contact-us' => 'Skontaktuj się z nami',
'places' => 'Miejsca',
'profiles' => 'Profile',
diff --git a/resources/views/discover/profiles/home.blade.php b/resources/views/discover/profiles/home.blade.php
index 009a004c..42daa88d 100644
--- a/resources/views/discover/profiles/home.blade.php
+++ b/resources/views/discover/profiles/home.blade.php
@@ -11,7 +11,6 @@
@endsection
@push('scripts')
-
@endpush
\ No newline at end of file
diff --git a/resources/views/layouts/partial/noauthnav.blade.php b/resources/views/layouts/partial/noauthnav.blade.php
index 797f1362..d01fb514 100644
--- a/resources/views/layouts/partial/noauthnav.blade.php
+++ b/resources/views/layouts/partial/noauthnav.blade.php
@@ -1,4 +1,4 @@
-
Stories
+