aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2019-07-16 13:55:02 +0200
committerPatrick Spek <p.spek@tyil.nl>2019-07-16 13:55:02 +0200
commit34686a73c628492692853f312af89e703899f06f (patch)
treea8c82f8a2265b919ed41f3f57b99691dc0dc3206
downloadMatrix::Bot::Plugin::AutoAcceptInvites-34686a73c628492692853f312af89e703899f06f.tar.gz
Matrix::Bot::Plugin::AutoAcceptInvites-34686a73c628492692853f312af89e703899f06f.tar.bz2
Initial commit
-rw-r--r--.editorconfig16
-rw-r--r--.gitignore14
-rw-r--r--.gitlab-ci.yml23
-rw-r--r--CHANGELOG.md9
-rw-r--r--META6.json25
-rw-r--r--README.pod641
-rw-r--r--lib/Matrix/Bot/Plugin/AutoAcceptInvites.pm630
7 files changed, 158 insertions, 0 deletions
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..74dde7f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,16 @@
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = tab
+indent_size = 4
+
+[*.json]
+indent_style = space
+indent_size = 2
+
+[*.yml]
+indent_style = space
+indent_size = 2
+
+# vim: ft=dosini
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..93356c2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+## Perl 6 precompilation files ##
+.precomp
+
+## Editor files ##
+
+# emacs
+*~
+
+# vim
+.*.sw?
+
+# comma
+.idea
+*.iml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..cfc1249
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,23 @@
+Matrix::Bot::Plugin::AutoAcceptInvites:
+ only:
+ - master
+ image: rakudo-star
+ before_script:
+ - zef install . --deps-only --test-depends --/test
+ script: AUTHOR_TESTING=1 prove -v -e "perl6 -Ilib" t
+ artifacts:
+ name: "perl6-Matrix-Bot-Plugin-AutoAcceptInvites"
+ paths:
+ - META6.json
+ - bin
+ - lib
+ - resources
+ - t
+
+test:
+ except:
+ - master
+ image: rakudo-star
+ before_script:
+ - zef install . --deps-only --test-depends --/test
+ script: AUTHOR_TESTING=1 prove -v -e "perl6 -Ilib" t
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..1003abb
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,9 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
+and this project adheres to [Semantic
+Versioning](http://semver.org/spec/v2.0.0.html).
+
+## [UNRELEASED]
+- Initial release
diff --git a/META6.json b/META6.json
new file mode 100644
index 0000000..1b14efb
--- /dev/null
+++ b/META6.json
@@ -0,0 +1,25 @@
+{
+ "api": "0",
+ "authors": [
+ "Patrick Spek <p.spek@tyil.work>"
+ ],
+ "depends": [
+ "Matrix::Bot"
+ ],
+ "description": "A plugin for Matrix::Bot to automatically accept all room invites",
+ "license": "AGPL-3.0",
+ "meta-version": 0,
+ "name": "Matrix::Bot::Plugin::AutoAcceptInvites",
+ "perl": "6.d",
+ "provides": {
+ "Matrix::Bot::Plugin::AutoAcceptInvites": "lib/Matrix/Bot/Plugin/AutoAcceptInvites.pm6"
+ },
+ "resources": [
+
+ ],
+ "source-url": "",
+ "tags": [
+
+ ],
+ "version": "0.0.0"
+}
diff --git a/README.pod6 b/README.pod6
new file mode 100644
index 0000000..3fe49b2
--- /dev/null
+++ b/README.pod6
@@ -0,0 +1,41 @@
+=begin pod
+
+=NAME Matrix::Bot::Plugin::AutoAcceptInvites
+=AUTHOR Patrick Spek <p.spek@tyil.work>
+=VERSION 0.0.0
+
+=head1 Description
+
+A plugin for Matrix::Bot to automatically accept all room invites
+
+=head1 Installation
+
+Install this module through L<zef|https://github.com/ugexe/zef>:
+
+=begin code :lang<sh>
+zef install Matrix::Bot::Plugin::AutoAcceptInvites
+=end code
+
+=head1 Usage
+
+To use this plugin in your Matrix bot, include it in the C<plugins> list.
+
+=begin code
+use Matrix::Bot;
+use Matrix::Bot::Plugin::AutoAcceptInvites;
+
+Matrix::Bot.new(
+ home-server => $*ENV<MATRIX_HOMESERVER> // "https://matrix.org",
+ username => %*ENV<USER>,
+ password => %*ENV<MATRIX_PASSWORD>,
+ plugins => [
+ Matrix::Bot::Plugin::AutoAcceptInvites.new,
+ ],
+);
+=end code
+
+=head1 License
+
+This module is distributed under the terms of the AGPL-3.0.
+
+=end pod
diff --git a/lib/Matrix/Bot/Plugin/AutoAcceptInvites.pm6 b/lib/Matrix/Bot/Plugin/AutoAcceptInvites.pm6
new file mode 100644
index 0000000..39bdd59
--- /dev/null
+++ b/lib/Matrix/Bot/Plugin/AutoAcceptInvites.pm6
@@ -0,0 +1,30 @@
+#! /usr/bin/env false
+
+use v6.d;
+
+use Matrix::Bot::Plugin;
+
+unit class Matrix::Bot::Plugin::AutoAcceptInvites is Matrix::Bot::Plugin;
+
+multi method handle-invite ($e --> Bool) {
+ self.log.info("Joining room {$e.room}, invited by {$e.user}");
+ True;
+}
+
+=begin pod
+
+=NAME Matrix::Bot::Plugin::AutoAcceptInvites
+=AUTHOR Patrick Spek <p.spek@tyil.work>
+=VERSION 0.0.0
+
+=head1 Synopsis
+
+=head1 Description
+
+=head1 Examples
+
+=head1 See also
+
+=end pod
+
+# vim: ft=perl6 noet