mirror of https://github.com/dani/patrix.git
Compare commits
4 Commits
2ea3589c4c
...
0c3d8eb501
Author | SHA1 | Date |
---|---|---|
Daniel Berteaud | 0c3d8eb501 | |
Daniel Berteaud | 5eceadb587 | |
Daniel Berteaud | 90f43a6ce6 | |
Allegiance Zone pusher | 0fb7bf849e |
|
@ -1 +1 @@
|
|||
0.1.15-1 ./
|
||||
0.1.16-1 ./
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Name: patrix
|
||||
Version: 0.1.15
|
||||
Version: 0.1.16
|
||||
Release: 1%{?dist}
|
||||
Summary: Command line client for Matrix
|
||||
|
||||
|
@ -23,6 +23,7 @@ Requires: perl(URI::Escape)
|
|||
Requires: perl(Term::ReadKey)
|
||||
Requires: perl(Hash::Merge::Simple)
|
||||
Requires: perl(Scalar::Util)
|
||||
Requires: perl(HTML::Strip)
|
||||
|
||||
%description
|
||||
Patrix is a simple (and quite limited) client for the Matrix communication network
|
||||
|
@ -52,6 +53,10 @@ room via the command line.
|
|||
%{_bindir}/patrix
|
||||
|
||||
%changelog
|
||||
* Mon Feb 13 2023 Daniel Berteaud <dbd@ehtrace.com> 0.1.16-1
|
||||
- Add HTML::Strip to Required (dbd@ehtrace.com)
|
||||
- Add HTML::Strip and always support HTML messages (imagotrigger@gmail.com)
|
||||
|
||||
* Tue Jul 26 2022 Daniel Berteaud <dbd@ehtrace.com> 0.1.15-1
|
||||
- Resign with new key
|
||||
|
||||
|
|
|
@ -15,8 +15,10 @@ use URI::Escape;
|
|||
use Term::ReadKey;
|
||||
use Hash::Merge::Simple qw(merge);
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use HTML::Strip;
|
||||
|
||||
our $opt;
|
||||
our $hs = HTML::Strip->new();
|
||||
|
||||
GetOptions(
|
||||
"user=s" => \$opt->{user},
|
||||
|
@ -256,8 +258,12 @@ sub send_msg {
|
|||
}
|
||||
my $json = {
|
||||
msgtype => ($opt->{action} eq 'send-notice') ? 'm.notice' : 'm.text',
|
||||
body => $opt->{message}
|
||||
body => $hs->parse($opt->{message}),
|
||||
formatted_body => $opt->{message},
|
||||
format => "org.matrix.custom.html",
|
||||
};
|
||||
$hs->eof();
|
||||
|
||||
# If we send code, we have to format it correctly
|
||||
if ($opt->{action} eq 'send-code'){
|
||||
$json->{formatted_body} = '<pre><code>' . $opt->{message} . '</code></pre>';
|
||||
|
|
Loading…
Reference in New Issue