Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MatrixPlugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stud.IP
Plugins
MatrixPlugin
Commits
48a02683
Commit
48a02683
authored
2 years ago
by
Thomas Hackl
Browse files
Options
Downloads
Patches
Plain Diff
get only one entry
parent
4f6644d9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MatrixPlugin.php
+6
-6
6 additions, 6 deletions
MatrixPlugin.php
plugin.manifest
+1
-1
1 addition, 1 deletion
plugin.manifest
with
7 additions
and
7 deletions
MatrixPlugin.php
+
6
−
6
View file @
48a02683
...
@@ -135,8 +135,8 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
...
@@ -135,8 +135,8 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
*/
*/
public
function
invite
(
$event
,
$membership
)
public
function
invite
(
$event
,
$membership
)
{
{
if
(
$matrix
=
MatrixAccount
::
findByUser_id
(
$membership
->
user_id
)
&&
if
(
$matrix
=
MatrixAccount
::
find
One
ByUser_id
(
$membership
->
user_id
)
&&
$room
=
MatrixRoom
::
findByRange_id
(
$membership
->
seminar_id
))
{
$room
=
MatrixRoom
::
find
One
ByRange_id
(
$membership
->
seminar_id
))
{
MatrixClient
::
get
()
->
inviteIntoRoom
(
MatrixClient
::
get
()
->
inviteIntoRoom
(
MatrixAccount
::
requireSystemAccount
(),
MatrixAccount
::
requireSystemAccount
(),
$room
->
getLinkedRoom
(),
$room
->
getLinkedRoom
(),
...
@@ -153,8 +153,8 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
...
@@ -153,8 +153,8 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
*/
*/
public
function
uninvite
(
$event
,
$membership
)
public
function
uninvite
(
$event
,
$membership
)
{
{
if
(
$matrix
=
MatrixAccount
::
findByUser_id
(
$membership
->
user_id
)
&&
if
(
$matrix
=
MatrixAccount
::
find
One
ByUser_id
(
$membership
->
user_id
)
&&
$room
=
MatrixRoom
::
findByRange_id
(
$membership
->
seminar_id
))
{
$room
=
MatrixRoom
::
find
One
ByRange_id
(
$membership
->
seminar_id
))
{
MatrixClient
::
get
()
->
leaveRoom
(
MatrixClient
::
get
()
->
leaveRoom
(
$matrix
->
getLinkedAccount
(),
$matrix
->
getLinkedAccount
(),
$room
->
getLinkedRoom
()
$room
->
getLinkedRoom
()
...
@@ -171,7 +171,7 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
...
@@ -171,7 +171,7 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
*/
*/
public
function
unregister
(
$event
,
$user
)
public
function
unregister
(
$event
,
$user
)
{
{
if
(
$account
=
MatrixAccount
::
findByUser_id
(
$user
->
id
))
{
if
(
$account
=
MatrixAccount
::
find
One
ByUser_id
(
$user
->
id
))
{
if
(
MatrixClient
::
get
()
->
deactivateAccount
(
$account
->
getLinkedAccount
()))
{
if
(
MatrixClient
::
get
()
->
deactivateAccount
(
$account
->
getLinkedAccount
()))
{
$account
->
delete
();
$account
->
delete
();
}
}
...
@@ -186,7 +186,7 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
...
@@ -186,7 +186,7 @@ class MatrixPlugin extends StudIPPlugin implements StandardPlugin
*/
*/
public
function
deleteRoom
(
$event
,
$course
)
public
function
deleteRoom
(
$event
,
$course
)
{
{
if
(
$room
=
MatrixRoom
::
findByRange_id
(
$course
->
id
))
{
if
(
$room
=
MatrixRoom
::
find
One
ByRange_id
(
$course
->
id
))
{
MatrixClient
::
get
()
->
deleteRoom
(
MatrixClient
::
get
()
->
deleteRoom
(
MatrixAccount
::
requireSystemAccount
(),
MatrixAccount
::
requireSystemAccount
(),
$room
->
getLinkedRoom
()
$room
->
getLinkedRoom
()
...
...
This diff is collapsed.
Click to expand it.
plugin.manifest
+
1
−
1
View file @
48a02683
pluginname=Matrix-Chat
pluginname=Matrix-Chat
pluginclassname=MatrixPlugin
pluginclassname=MatrixPlugin
origin=data-quest
origin=data-quest
version=1.4.
2
version=1.4.
3
screenshot=assets/images/matrix_logo.png
screenshot=assets/images/matrix_logo.png
description=Matrix chat for Stud.IP courses
description=Matrix chat for Stud.IP courses
studipMinVersion=4.5
studipMinVersion=4.5
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment