mirror of
https://github.com/pushbits/server.git
synced 2025-05-25 14:56:34 +02:00
Implement deletion of applications
This commit is contained in:
parent
653e57fe03
commit
18d11677ac
7 changed files with 80 additions and 9 deletions
|
@ -6,7 +6,7 @@ import (
|
|||
"github.com/matrix-org/gomatrix"
|
||||
)
|
||||
|
||||
// RegisterApplication creates a new channel for the application.
|
||||
// RegisterApplication creates a new channel for an application.
|
||||
func (d *Dispatcher) RegisterApplication(name, user string) (string, error) {
|
||||
log.Printf("Registering application %s, notifications will be relayed to user %s.\n", name, user)
|
||||
|
||||
|
@ -27,3 +27,16 @@ func (d *Dispatcher) RegisterApplication(name, user string) (string, error) {
|
|||
|
||||
return response.RoomID, err
|
||||
}
|
||||
|
||||
// DeregisterApplication deletes a channel for an application.
|
||||
func (d *Dispatcher) DeregisterApplication(matrixID string) error {
|
||||
log.Printf("Deregistering application with ID %s.\n", matrixID)
|
||||
|
||||
_, err := d.client.LeaveRoom(matrixID)
|
||||
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue