/' 
# TI-Messenger 1.1
# TI-Messenger-Dienst
# UC - 10064
# Sequence Diagram
# Name: Föderationszugehörigkeit eines Messenger-Service prüfen
'/

@startuml
skinparam sequenceMessageAlign direction
skinparam minClassWidth 200
skinparam BoxPadding 1
skinparam sequenceReferenceHeaderBackgroundColor palegreen
scale max 2048 width

skinparam sequence {
ArrowColor black
ArrowFontSize 17
ActorBorderColor black
LifeLineBorderColor black
LifeLineBackgroundColor Gainsboro

ParticipantBorderColor Motivation
ParticipantBackgroundColor Motivation
ParticipantFontName Impact
ParticipantFontSize 20
ParticipantFontColor black
ParticipantBorderColor Black
ParticipantBackgroundColor MOTIVATION

ActorBackgroundColor Gainsboro
ActorFontColor black
ActorFontSize 20
ActorFontName Aapex
}

autonumber

    box <size:18>Messenger-Service\n#WhiteSmoke
    participant MP as "Messenger-Proxy"
    participant MH as "Matrix-Homeserver"
    participant RD as "Registrierungs-Dienst"
    end box
    participant VZD as "VZD-FHIR-Directory"

|||
    Activate MP
  MP->MP: prüfe im Event\nob Matrix-Domain(s) \nin der Föderationsliste \nvorhanden ist/sind

|||
alt#LightGrey  <size:16>Matrix-Domain ist in der Föderationsliste enthalten ODER Matrix-Domain des Senders = Matrix-Domain des Empfängers</size>
    ||| 
    MP->MH: HTTP(S) Forward
      Activate MH
    MH-->MP: Status
      Deactivate MH
      'Deactivate MP
    ||| 


  else <size:16>Matrix-Domain ist nicht in der Föderationsliste enthalten</size> 
  |||  
  ref over MP, VZD: <size:17>**Anhang B** - Aktualisierung der Föderationsliste</size>\n 
  |||
  MP->MP: prüfe ob Matrix-Domain \nder MXID \nin der **aktualisierten** \nFöderationsliste vorhanden ist
  |||

    alt#LightGrey #LightBlue <size:16>Matrix-Domain ist nicht in der aktualisierten Föderationsliste enthalten</size>
      |||
      MP->MP: <font color=red>Abbruch, Verbindung wird abgelehnt</font>
      ||| 
      else <size:16>Matrix-Domain ist in der aktualisierten Föderationsliste enthalten</size>
      |||
         MP->MH: HTTP(S) Forward
          Activate MH
        MH-->MP: Status
          Deactivate MH
      |||
    end

  |||

end
|||
@enduml
