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
Feature: pastebin #329
Conversation
d98a412
to
a036343
Compare
t/web-x-request-base.t
Outdated
@@ -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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should check that path is /sub for base_url
lib/Convos/Core/Connection/Irc.pm
Outdated
sub { | ||
my ($backend, $err, $file) = @_; | ||
return $self->$cb($err) if $err; | ||
my $url = $self->user->core->base_url->clone->path($file->uri); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to use base_url as base, not basis for created url.
lib/Convos/Plugin/Paste.pm
Outdated
} | ||
|
||
package # \ | ||
Convos::Plugin::Paste::File; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ugly 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest making this a public class.
5223a71
to
a79103d
Compare
I don't understand why it's not resolved after I pushed the new changes.
a79103d
to
5a5c26a
Compare
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:
This is how it looks to a Convos user: (The paste is embedded using LinkEmbedder.pm)
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/