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

Feature: pastebin #329

Merged
merged 3 commits into from Apr 13, 2017
Merged

Feature: pastebin #329

merged 3 commits into from Apr 13, 2017

Conversation

@jhthorsen
Copy link
Member

@jhthorsen jhthorsen commented Apr 3, 2017

This PR implements a pastebin internally to Convos. It is implemented in the backend, meaning that a given connection class can detect a long message and dispatch it to the "paste-service". This is done automatically, without asking the user.

The nice thing is that it's implemented as a plugin, so if someone wants to make a "gist" backend, then it shouldn't be too hard.

This is how you enter a paste:

screen shot 2017-04-04 at 09 19 33

This is how it looks to a Convos user: (The paste is embedded using LinkEmbedder.pm)

170404-convos-pastebin-linkembedder

This is how it looks if you open the link in a browser: (The link is available from the public)

Note also that the paste support syntax highlighting, using https://highlightjs.org/

170404-convos-pastebin-public

@jhthorsen jhthorsen self-assigned this Apr 3, 2017
@jhthorsen jhthorsen force-pushed the feature/pastebin branch from d98a412 to a036343 Apr 3, 2017
@jhthorsen jhthorsen requested a review from marcusramberg Apr 4, 2017
@@ -8,4 +8,6 @@ $t->get_ok('/x/request/base')->status_is(200)->content_is('/foo');
$t->get_ok('/x/request/base', {'X-Request-Base' => 'http://example.com/sub'})->status_is(200)
->content_is('/sub/foo');

like $t->app->core->base_url, qr{^http://example\.com}, 'core base_url';

This comment has been minimized.

@marcusramberg

marcusramberg Apr 4, 2017
Member

should check that path is /sub for base_url

sub {
my ($backend, $err, $file) = @_;
return $self->$cb($err) if $err;
my $url = $self->user->core->base_url->clone->path($file->uri);

This comment has been minimized.

@marcusramberg

marcusramberg Apr 4, 2017
Member

Needs to use base_url as base, not basis for created url.

}

package # \
Convos::Plugin::Paste::File;

This comment has been minimized.

@marcusramberg

marcusramberg Apr 4, 2017
Member

This is ugly 👎

This comment has been minimized.

@marcusramberg

marcusramberg Apr 4, 2017
Member

I suggest making this a public class.

@jhthorsen jhthorsen force-pushed the feature/pastebin branch from 5223a71 to a79103d Apr 13, 2017
@jhthorsen jhthorsen dismissed marcusramberg’s stale review Apr 13, 2017

I don't understand why it's not resolved after I pushed the new changes.

@jhthorsen jhthorsen force-pushed the feature/pastebin branch from a79103d to 5a5c26a Apr 13, 2017
@jhthorsen jhthorsen merged commit 8d5be29 into master Apr 13, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@jhthorsen jhthorsen deleted the feature/pastebin branch Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.