MatrixRoomUtils

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

DefaultRoomCreationTemplate.cs (3746B)


      1 using MatrixRoomUtils.Core;
      2 using MatrixRoomUtils.Core.Responses;
      3 
      4 namespace MatrixRoomUtils.Web.Classes.RoomCreationTemplates;
      5 
      6 public class DefaultRoomCreationTemplate : IRoomCreationTemplate
      7 {
      8     public string Name => "Default";
      9     public CreateRoomRequest CreateRoomRequest
     10     {
     11         get
     12         {
     13             return new()
     14             {
     15                 Name = "My new room",
     16                 RoomAliasName = "myroom",
     17                 InitialState = new()
     18                 {
     19                     new()
     20                     {
     21                         Type = "m.room.history_visibility",
     22                         Content = new
     23                         {
     24                             history_visibility = "world_readable"
     25                         }
     26                     },
     27 new StateEvent<Pages.RoomManager.RoomManagerCreateRoom.GuestAccessContent>
     28 {
     29     Type = "m.room.guest_access",
     30     Content = new()
     31     {
     32         GuestAccess = "can_join"
     33     }
     34 },
     35                     new()
     36                     {
     37                         Type = "m.room.join_rules",
     38                         Content = new
     39                         {
     40                             join_rule = "public"
     41                         }
     42                     },
     43                     new()
     44                     {
     45                         Type = "m.room.server_acl",
     46                         Content = new
     47                         {
     48                             allow = new[] { "*" },
     49                             deny = Array.Empty<string>(),
     50                             allow_ip_literals = false
     51                         }
     52                     },
     53                     new()
     54                     {
     55                         Type = "m.room.avatar",
     56                         Content = new
     57                         {
     58                             url = "mxc://feline.support/UKNhEyrVsrAbYteVvZloZcFj"
     59                         }
     60                     }
     61                 },
     62                 Visibility = "public",
     63                 PowerLevelContentOverride = new()
     64                 {
     65                     UsersDefault = 0,
     66                     EventsDefault = 100,
     67                     StateDefault = 50,
     68                     Invite = 0,
     69                     Redact = 50,
     70                     Kick = 50,
     71                     Ban = 50,
     72                     NotificationsPl = new()
     73                     {
     74                         Room = 50
     75                     },
     76                     Events = new()
     77                     {
     78                         { "im.vector.modular.widgets", 50 },
     79                         { "io.element.voice_broadcast_info", 50 },
     80                         { "m.reaction", 100 },
     81                         { "m.room.avatar", 50 },
     82                         { "m.room.canonical_alias", 50 },
     83                         { "m.room.encryption", 100 },
     84                         { "m.room.history_visibility", 100 },
     85                         { "m.room.name", 50 },
     86                         { "m.room.pinned_events", 50 },
     87                         { "m.room.power_levels", 100 },
     88                         { "m.room.redaction", 100 },
     89                         { "m.room.server_acl", 100 },
     90                         { "m.room.tombstone", 100 },
     91                         { "m.room.topic", 50 },
     92                         { "m.space.child", 50 },
     93                         { "org.matrix.msc3401.call", 50 },
     94                         { "org.matrix.msc3401.call.member", 50 }
     95                     },
     96                     Users = new()
     97                     {
     98                         { RuntimeCache.CurrentHomeServer.UserId, 100 },
     99                     },
    100                 },
    101                 CreationContent = new()
    102                 {
    103                     {
    104                         "type", null
    105                     }
    106                 }
    107             };
    108         }
    109     }
    110 }