From e058b50a2e33887a5f5f0ff2b6e2358de161d413 Mon Sep 17 00:00:00 2001 From: Mykhailo Prakhov <117639195+mprakhov@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:15:46 +0200 Subject: [PATCH] feat: community admin permission functionality (#3569) * feat: community admin implementation * fix: code review fixes * chore: request admin permissions in CheckPermissionToJoin, unit test fix --- appdatabase/migrations/bindata.go | 140 +- appdatabase/migrationsprevnodecfg/bindata.go | 108 +- mailserver/migrations/bindata.go | 6 +- multiaccounts/migrations/bindata.go | 24 +- protocol/anonmetrics/migrations/migrations.go | 6 +- protocol/communities/community.go | 492 ++++-- protocol/communities/community_admin_event.go | 346 ++++ protocol/communities/community_categories.go | 387 +++-- .../communities/community_categories_test.go | 18 +- protocol/communities/community_test.go | 26 +- protocol/communities/errors.go | 2 + protocol/communities/manager.go | 566 ++++-- protocol/communities/persistence.go | 4 + protocol/communities/request_to_join.go | 9 + protocol/communities_messenger_admin_test.go | 1534 +++++++++++++++++ protocol/communities_messenger_test.go | 16 +- protocol/encryption/migrations/migrations.go | 40 +- protocol/messenger.go | 15 +- protocol/messenger_communities.go | 64 +- protocol/messenger_handler.go | 7 +- protocol/messenger_pin_messages.go | 4 +- protocol/messenger_response.go | 6 +- protocol/migrations/migrations.go | 188 +- .../application_metadata_message.pb.go | 14 +- .../application_metadata_message.proto | 1 + protocol/protobuf/communities.pb.go | 262 +-- protocol/protobuf/communities.proto | 5 +- .../protobuf/community_admin_update.pb.go | 495 ++++++ .../protobuf/community_admin_update.proto | 64 + protocol/protobuf/service.go | 2 +- .../migrations/migrations.go | 14 +- .../migrations/migrations.go | 10 +- protocol/requests/add_role_to_member.go | 2 +- protocol/requests/remove_role_from_member.go | 2 +- protocol/transport/migrations/migrations.go | 12 +- protocol/v1/status_message.go | 3 + services/chat/api.go | 25 +- static/bindata.go | 40 +- t/bindata.go | 6 +- 39 files changed, 4051 insertions(+), 914 deletions(-) create mode 100644 protocol/communities/community_admin_event.go create mode 100644 protocol/communities_messenger_admin_test.go create mode 100644 protocol/protobuf/community_admin_update.pb.go create mode 100644 protocol/protobuf/community_admin_update.proto diff --git a/appdatabase/migrations/bindata.go b/appdatabase/migrations/bindata.go index 6dd9d2eef..8607ac94c 100644 --- a/appdatabase/migrations/bindata.go +++ b/appdatabase/migrations/bindata.go @@ -153,7 +153,7 @@ func _1640111208_dummyUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xf0, 0xae, 0x20, 0x6e, 0x75, 0xd1, 0x36, 0x14, 0xf2, 0x40, 0xe5, 0xd6, 0x7a, 0xc4, 0xa5, 0x72, 0xaa, 0xb5, 0x4d, 0x71, 0x97, 0xb8, 0xe8, 0x95, 0x22, 0x95, 0xa2, 0xac, 0xaf, 0x48, 0x58}} return a, nil } @@ -173,7 +173,7 @@ func _1642666031_add_removed_clock_to_bookmarksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x4e, 0x38, 0x99, 0x7a, 0xc, 0x90, 0x13, 0xec, 0xfe, 0x2f, 0x55, 0xff, 0xb7, 0xb6, 0xaa, 0x96, 0xc6, 0x92, 0x79, 0xcc, 0xee, 0x4e, 0x99, 0x53, 0xfe, 0x1c, 0xbb, 0x32, 0x2, 0xa4, 0x27}} return a, nil } @@ -193,7 +193,7 @@ func _1643644541_gif_api_key_settingUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1b, 0x94, 0x28, 0xfb, 0x66, 0xd1, 0x7c, 0xb8, 0x89, 0xe2, 0xb4, 0x71, 0x65, 0x24, 0x57, 0x22, 0x95, 0x38, 0x97, 0x3, 0x9b, 0xc6, 0xa4, 0x41, 0x7b, 0xba, 0xf7, 0xdb, 0x70, 0xf7, 0x20, 0x3a}} return a, nil } @@ -213,7 +213,7 @@ func _1644188994_recent_stickersUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0xad, 0xaa, 0x30, 0xbf, 0x4, 0x7, 0xf8, 0xc3, 0x3, 0xb8, 0x97, 0x23, 0x2b, 0xbd, 0x1c, 0x60, 0x69, 0xb0, 0x42, 0x5e, 0x6b, 0xd, 0xa7, 0xa3, 0x6b, 0x2e, 0xdc, 0x70, 0x13, 0x72, 0x7}} return a, nil } @@ -233,7 +233,7 @@ func _1646659233_add_address_to_dapp_permisssionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0xb0, 0x35, 0xcc, 0x2e, 0x16, 0xe6, 0x15, 0x86, 0x2c, 0x37, 0x80, 0xae, 0xa3, 0xc5, 0x31, 0x78, 0x5, 0x9d, 0xcd, 0x7b, 0xeb, 0x5f, 0xf2, 0xb3, 0x74, 0x72, 0xdf, 0xcf, 0x88, 0xb, 0x40}} return a, nil } @@ -253,7 +253,7 @@ func _1646841105_add_emoji_accountUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe6, 0x77, 0x29, 0x95, 0x18, 0x64, 0x82, 0x63, 0xe7, 0xaf, 0x6c, 0xa9, 0x15, 0x7d, 0x46, 0xa6, 0xbc, 0xdf, 0xa7, 0xd, 0x2b, 0xd2, 0x2d, 0x97, 0x4d, 0xa, 0x6b, 0xd, 0x6e, 0x90, 0x42, 0x5c}} return a, nil } @@ -273,7 +273,7 @@ func _1647278782_display_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xa1, 0x1f, 0x3e, 0x61, 0x65, 0x8d, 0xff, 0xee, 0xde, 0xc5, 0x91, 0xd9, 0x5c, 0xb5, 0xe2, 0xf0, 0xb7, 0xe7, 0x5c, 0x5c, 0x16, 0x25, 0x89, 0xee, 0x78, 0x12, 0xea, 0x3e, 0x48, 0x41, 0xa6}} return a, nil } @@ -293,7 +293,7 @@ func _1647862838_reset_last_backupUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xe3, 0xd5, 0xf6, 0x5f, 0xfe, 0x65, 0xfa, 0x1d, 0x88, 0xf8, 0x5f, 0x24, 0x71, 0x34, 0x68, 0x96, 0x2a, 0x60, 0x87, 0x15, 0x82, 0x4d, 0x8a, 0x59, 0x3d, 0x1f, 0xd8, 0x56, 0xd4, 0xfb, 0xda}} return a, nil } @@ -313,7 +313,7 @@ func _1647871652_add_settings_sync_clock_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd8, 0x58, 0xec, 0x85, 0x90, 0xfa, 0x30, 0x98, 0x98, 0x9a, 0xa6, 0xa8, 0x96, 0x2b, 0x38, 0x93, 0xf3, 0xae, 0x46, 0x74, 0xa4, 0x41, 0x62, 0x9b, 0x2, 0x86, 0xbf, 0xe5, 0x2a, 0xce, 0xe2, 0xc0}} return a, nil } @@ -333,7 +333,7 @@ func _1647880168_add_torrent_configUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0x92, 0x22, 0x37, 0x96, 0xf3, 0xb5, 0x5b, 0x27, 0xd0, 0x7d, 0x43, 0x5, 0x4e, 0x9d, 0xe2, 0x49, 0xbe, 0x86, 0x31, 0xa1, 0x89, 0xff, 0xd6, 0x51, 0xe0, 0x9c, 0xb, 0xda, 0xfc, 0xf2, 0x93}} return a, nil } @@ -353,7 +353,7 @@ func _1647882837_add_communities_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbd, 0x87, 0x78, 0x99, 0xd9, 0x5d, 0xbd, 0xf7, 0x57, 0x9c, 0xca, 0x97, 0xbd, 0xb3, 0xe9, 0xb5, 0x89, 0x31, 0x3f, 0xf6, 0x5c, 0x13, 0xb, 0xc3, 0x54, 0x93, 0x18, 0x40, 0x7, 0x82, 0xfe, 0x7e}} return a, nil } @@ -373,7 +373,7 @@ func _1647956635_add_waku_messages_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0xe, 0xe1, 0xdc, 0xda, 0x2e, 0x89, 0x8d, 0xdc, 0x2a, 0x1c, 0x13, 0xa1, 0xfc, 0xfe, 0xf, 0xb2, 0xb9, 0x85, 0xc8, 0x45, 0xd6, 0xd1, 0x7, 0x5c, 0xa3, 0x8, 0x47, 0x44, 0x6d, 0x96, 0xe0}} return a, nil } @@ -393,7 +393,7 @@ func _1648554928_network_testUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9a, 0xc5, 0x7f, 0x87, 0xf3, 0x2c, 0xf7, 0xbb, 0xd3, 0x3a, 0x4e, 0x76, 0x88, 0xca, 0xaf, 0x73, 0xce, 0x8f, 0xa1, 0xf6, 0x3d, 0x4d, 0xed, 0x6f, 0x49, 0xf2, 0xfe, 0x56, 0x2a, 0x60, 0x68, 0xca}} return a, nil } @@ -413,7 +413,7 @@ func _1649174829_add_visitble_tokenUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa3, 0x22, 0xc0, 0x2b, 0x3f, 0x4f, 0x3d, 0x5e, 0x4c, 0x68, 0x7c, 0xd0, 0x15, 0x36, 0x9f, 0xec, 0xa1, 0x2a, 0x7b, 0xb4, 0xe3, 0xc6, 0xc9, 0xb4, 0x81, 0x50, 0x4a, 0x11, 0x3b, 0x35, 0x7, 0xcf}} return a, nil } @@ -433,7 +433,7 @@ func _1649882262_add_derived_from_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x11, 0xb9, 0x44, 0x4d, 0x85, 0x8d, 0x7f, 0xb4, 0xae, 0x4f, 0x5c, 0x66, 0x64, 0xb6, 0xe2, 0xe, 0x3d, 0xad, 0x9d, 0x8, 0x4f, 0xab, 0x6e, 0xa8, 0x7d, 0x76, 0x3, 0xad, 0x96, 0x1, 0xee, 0x5c}} return a, nil } @@ -453,7 +453,7 @@ func _1650612625_add_community_message_archive_hashes_tableUpSql() (*asset, erro return nil, err } - info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0x31, 0xb3, 0x75, 0x23, 0xe2, 0x45, 0xe, 0x47, 0x1b, 0x35, 0xa5, 0x6e, 0x83, 0x4e, 0x64, 0x7d, 0xd7, 0xa2, 0xda, 0xe9, 0x53, 0xf1, 0x16, 0x86, 0x2c, 0x57, 0xad, 0xfa, 0xca, 0x39, 0xde}} return a, nil } @@ -473,7 +473,7 @@ func _1650616788_add_communities_archives_info_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0x4f, 0x80, 0x45, 0xb9, 0xd9, 0x15, 0xe2, 0x78, 0xd0, 0xcb, 0x71, 0xc1, 0x1b, 0xb7, 0x1b, 0x1b, 0x97, 0xfe, 0x47, 0x53, 0x3c, 0x62, 0xbc, 0xdd, 0x3a, 0x94, 0x1a, 0xc, 0x48, 0x76, 0xe}} return a, nil } @@ -493,7 +493,7 @@ func _1652715604_add_clock_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0xd9, 0x8d, 0x73, 0xc9, 0xef, 0xfa, 0xb1, 0x4b, 0xa5, 0xf3, 0x5, 0x19, 0x26, 0x46, 0xf8, 0x47, 0x93, 0xdb, 0xac, 0x2, 0xef, 0xf9, 0x71, 0x56, 0x83, 0xe6, 0x2d, 0xb0, 0xd7, 0x83, 0x5c}} return a, nil } @@ -513,7 +513,7 @@ func _1653037334_add_notifications_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4b, 0xc4, 0x65, 0xac, 0xa, 0xf2, 0xef, 0xb6, 0x39, 0x3c, 0xc5, 0xb1, 0xb2, 0x9c, 0x86, 0x58, 0xe0, 0x38, 0xcb, 0x57, 0x3c, 0x76, 0x73, 0x87, 0x79, 0x4e, 0xf6, 0xed, 0xb0, 0x8e, 0x9e, 0xa}} return a, nil } @@ -533,7 +533,7 @@ func _1654702119_add_mutual_contact_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x26, 0x66, 0x67, 0x50, 0xfe, 0xd7, 0xe3, 0x29, 0x8b, 0xff, 0x9d, 0x5a, 0x87, 0xa7, 0x99, 0x6e, 0xd6, 0xcd, 0x2e, 0xbb, 0x17, 0xdf, 0x7f, 0xf7, 0xa3, 0xfa, 0x32, 0x7c, 0x2d, 0x92, 0xc8, 0x74}} return a, nil } @@ -553,7 +553,7 @@ func _1655375270_add_clock_field_to_communities_settings_tableUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x19, 0xc5, 0xc0, 0xf9, 0x84, 0x53, 0xdf, 0x83, 0xcf, 0xb6, 0x40, 0x6d, 0xf5, 0xdc, 0x77, 0x37, 0xb7, 0xe3, 0xa, 0x75, 0xe7, 0x6, 0x11, 0xca, 0x2b, 0x51, 0x92, 0xdd, 0x7d, 0xdb, 0xc3, 0xf5}} return a, nil } @@ -573,7 +573,7 @@ func _1655385721_drop_networks_configUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfc, 0xa7, 0x20, 0xbb, 0x67, 0x21, 0xe, 0xc6, 0xc8, 0x21, 0x74, 0xe0, 0xce, 0xc8, 0xe2, 0x2, 0xb4, 0xea, 0xf0, 0xe5, 0xc4, 0x4d, 0xdd, 0xd4, 0x52, 0x31, 0xa9, 0x3d, 0xcd, 0xd8, 0x9b, 0xab}} return a, nil } @@ -593,7 +593,7 @@ func _1655385724_networks_chaincolor_shortnameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd9, 0xe7, 0x84, 0xbb, 0x5f, 0xd2, 0x2c, 0x42, 0x88, 0x62, 0x52, 0xb6, 0x58, 0x31, 0xac, 0xc, 0x96, 0x2b, 0x1b, 0xe5, 0x4e, 0x9a, 0x3a, 0xf6, 0xf6, 0xfc, 0xa9, 0x1a, 0x35, 0x62, 0x28, 0x88}} return a, nil } @@ -613,7 +613,7 @@ func _1655456688_add_deleted_at_field_to_bookmarks_tableUpSql() (*asset, error) return nil, err } - info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe7, 0x9a, 0xbd, 0x9a, 0xc9, 0xf, 0xdf, 0x90, 0x0, 0x5d, 0xea, 0x6e, 0x7d, 0x51, 0x95, 0xcd, 0x90, 0xd3, 0x1a, 0x36, 0x6c, 0xf4, 0xbd, 0xa7, 0x6b, 0xbf, 0xe5, 0xdb, 0xa3, 0x88, 0xe3, 0x50}} return a, nil } @@ -633,7 +633,7 @@ func _1655462032_create_bookmarks_deleted_at_indexUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf, 0x8e, 0x20, 0x6b, 0x14, 0x9e, 0xcd, 0x97, 0xd3, 0xfe, 0x62, 0x3, 0x26, 0x59, 0x1, 0x6c, 0x99, 0xef, 0x6d, 0x21, 0xd4, 0xb5, 0xa3, 0xf4, 0x39, 0x40, 0x54, 0x6, 0xd, 0x60, 0x13, 0x38}} return a, nil } @@ -653,7 +653,7 @@ func _1657617291_add_multi_transactions_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x86, 0xb0, 0x4e, 0x8c, 0x4, 0x82, 0xb4, 0x43, 0xaa, 0xd0, 0x16, 0xdd, 0xcb, 0x88, 0x81, 0xac, 0x4, 0x34, 0x1a, 0x8f, 0x2e, 0xc5, 0x69, 0xb, 0xf0, 0x17, 0xf7, 0xe3, 0x9, 0xe, 0x54, 0xe0}} return a, nil } @@ -673,7 +673,7 @@ func _1660134042_add_social_links_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x73, 0xb6, 0xe7, 0x3f, 0xaa, 0x39, 0x9a, 0x56, 0x56, 0x31, 0xf1, 0x8e, 0x26, 0x23, 0x1, 0xe4, 0xfa, 0x98, 0xfe, 0x78, 0x87, 0x20, 0xcb, 0x52, 0xf4, 0x38, 0x7f, 0xc4, 0x1c, 0x4, 0x22}} return a, nil } @@ -693,7 +693,7 @@ func _1660134060_settings_bioUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0x25, 0xa0, 0xa6, 0x47, 0xff, 0xbc, 0x2a, 0x0, 0xff, 0x59, 0x4b, 0xb0, 0xc9, 0x4e, 0x15, 0xe4, 0xd9, 0xda, 0xeb, 0xfe, 0x55, 0x98, 0xc3, 0x9d, 0x96, 0xe7, 0xf, 0xd1, 0x5c, 0x93, 0x73}} return a, nil } @@ -713,7 +713,7 @@ func _1660134070_add_wakuv2_storeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1d, 0xe6, 0xc3, 0x9, 0xef, 0xdc, 0xae, 0x49, 0x30, 0x78, 0x54, 0xd6, 0xdb, 0xbf, 0xc0, 0x8e, 0x25, 0x8f, 0xfc, 0x67, 0x80, 0x39, 0x37, 0xd4, 0x86, 0xc1, 0x85, 0xc8, 0x99, 0xc4, 0x59, 0xd4}} return a, nil } @@ -733,7 +733,7 @@ func _1660134072_waku2_store_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xeb, 0xb4, 0xa0, 0xa1, 0x2b, 0xcb, 0x4c, 0x3c, 0xc6, 0xd0, 0xe8, 0x96, 0xe3, 0x96, 0xf1, 0x4f, 0x1f, 0xe0, 0xe7, 0x1f, 0x85, 0xa3, 0xe, 0xf7, 0x52, 0x56, 0x63, 0x2b, 0xb0, 0x87, 0x7b}} return a, nil } @@ -753,7 +753,7 @@ func _1662365868_add_key_uid_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc6, 0xd8, 0x2f, 0x2f, 0x3b, 0xa8, 0xbd, 0x6d, 0xf6, 0x87, 0x7e, 0xd2, 0xf1, 0xa2, 0xf7, 0x81, 0x6a, 0x23, 0x10, 0xbc, 0xbf, 0x5b, 0xe7, 0x2b, 0x9c, 0xa9, 0x8a, 0x18, 0xbb, 0xd0, 0x86, 0x91}} return a, nil } @@ -773,7 +773,7 @@ func _1662447680_add_keypairs_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdc, 0x25, 0xa9, 0xc7, 0x63, 0x27, 0x97, 0x35, 0x5f, 0x6b, 0xab, 0x26, 0xcb, 0xf9, 0xbd, 0x5e, 0xac, 0x3, 0xa0, 0x5e, 0xb9, 0x71, 0xa3, 0x1f, 0xb3, 0x4f, 0x7f, 0x79, 0x28, 0x48, 0xbe, 0xc}} return a, nil } @@ -793,7 +793,7 @@ func _1662460056_move_favourites_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xa2, 0x8c, 0xa3, 0xec, 0xad, 0xdf, 0xc3, 0x48, 0x5, 0x9b, 0x50, 0x25, 0x59, 0xae, 0x7d, 0xee, 0x58, 0xd2, 0x41, 0x27, 0xf2, 0x22, 0x2e, 0x9a, 0xb9, 0x4a, 0xcc, 0x38, 0x6e, 0x3a, 0xb2}} return a, nil } @@ -813,7 +813,7 @@ func _1662738097_add_base_fee_transactionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0xfb, 0x10, 0xae, 0xfc, 0x77, 0x70, 0x98, 0x6f, 0xec, 0xaa, 0xcd, 0x7, 0xc7, 0x74, 0x23, 0xc, 0xd5, 0x1e, 0x82, 0xdd, 0xfe, 0xff, 0x3b, 0xd2, 0x49, 0x10, 0x5b, 0x30, 0xc, 0x2d, 0xb0}} return a, nil } @@ -833,7 +833,7 @@ func _1662972194_add_keypairs_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x76, 0xf2, 0x86, 0xe1, 0x7e, 0xe9, 0x47, 0x32, 0x48, 0xd5, 0x6b, 0xe5, 0xd, 0xab, 0xb7, 0xf1, 0xd4, 0xf1, 0xad, 0x38, 0xa6, 0x11, 0xe7, 0xce, 0x5c, 0x11, 0x11, 0xf, 0x47, 0xb2, 0x4}} return a, nil } @@ -853,7 +853,7 @@ func _1664392661_add_third_party_id_to_waku_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x67, 0x66, 0x9e, 0x66, 0x74, 0xce, 0x1c, 0xb, 0x1b, 0x9d, 0xd5, 0xfc, 0x65, 0xe, 0x83, 0x90, 0x4c, 0x61, 0x4e, 0x6b, 0xe7, 0x86, 0xbe, 0x36, 0x4f, 0x91, 0x36, 0x4, 0x47, 0x7b, 0x82}} return a, nil } @@ -873,7 +873,7 @@ func _1664783660_add_sync_info_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x67, 0x7c, 0x3a, 0x95, 0x4e, 0x55, 0xb2, 0xbd, 0xb4, 0x18, 0x93, 0xc1, 0xcf, 0x9f, 0x12, 0xbb, 0x49, 0x8a, 0x2a, 0x6a, 0x2a, 0x7f, 0xad, 0x44, 0xc3, 0xf, 0x3a, 0x79, 0x18, 0xb9, 0x4c, 0x64}} return a, nil } @@ -893,7 +893,7 @@ func _1668109917_wakunodesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x29, 0xaa, 0x9e, 0x2, 0x66, 0x85, 0x69, 0xa8, 0xd9, 0xe2, 0x4b, 0x8d, 0x2a, 0x9c, 0xdf, 0xd2, 0xef, 0x64, 0x58, 0xe3, 0xa6, 0xe7, 0xc1, 0xd1, 0xc8, 0x9c, 0xc0, 0x2c, 0x1, 0xa8, 0x7b, 0x81}} return a, nil } @@ -913,7 +913,7 @@ func _1670249678_display_name_to_settings_sync_clock_tableUpSql() (*asset, error return nil, err } - info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0x18, 0xdc, 0xc4, 0x1f, 0x79, 0x22, 0x16, 0x4d, 0xdf, 0x6c, 0x66, 0xd5, 0xa4, 0x88, 0x5d, 0x5, 0x37, 0xa7, 0x41, 0x5, 0x50, 0xae, 0x12, 0xfa, 0x7e, 0x89, 0x24, 0x5c, 0xae, 0x30, 0xfc}} return a, nil } @@ -933,7 +933,7 @@ func _1670836810_add_imported_flag_to_community_archive_hashesUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6f, 0xf, 0xf0, 0xbd, 0xfe, 0x63, 0x25, 0x8f, 0x5e, 0x46, 0x4b, 0x45, 0x31, 0x8b, 0x3e, 0xd8, 0x6b, 0x5d, 0x9d, 0x6d, 0x10, 0x9a, 0x87, 0x4b, 0x18, 0xc6, 0x39, 0x81, 0x6e, 0xe4, 0x75, 0xfb}} return a, nil } @@ -953,7 +953,7 @@ func _1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql() (*asset, return nil, err } - info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xda, 0x8b, 0x4b, 0xd6, 0xd8, 0xe2, 0x3d, 0xf7, 0x6b, 0xcd, 0x1e, 0x70, 0x9, 0x2e, 0x35, 0x4, 0x61, 0xc3, 0xb5, 0x9d, 0xc5, 0x27, 0x21, 0xa, 0x5a, 0xd6, 0x3e, 0xa6, 0x24, 0xa2, 0x12, 0xdf}} return a, nil } @@ -973,7 +973,7 @@ func _1672933930_switcher_cardUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0xba, 0xdc, 0xbb, 0x40, 0x4, 0xf2, 0x10, 0xdf, 0xb4, 0xd2, 0x80, 0x8a, 0x74, 0x4d, 0xf6, 0xbc, 0x50, 0x7, 0xd, 0x22, 0x7f, 0xc4, 0xaf, 0xaa, 0xde, 0xdc, 0x71, 0xe9, 0x42, 0x98, 0x36}} return a, nil } @@ -993,7 +993,7 @@ func _1674056187_add_price_cacheUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x79, 0x6a, 0x9b, 0x28, 0xd1, 0x22, 0xf0, 0x84, 0x76, 0x40, 0x39, 0x49, 0x15, 0x5d, 0xaa, 0xfd, 0x11, 0xff, 0x13, 0x27, 0x42, 0x12, 0xfa, 0x82, 0xe6, 0x7a, 0xf0, 0x5e, 0x1f, 0xe3, 0xba}} return a, nil } @@ -1013,7 +1013,7 @@ func _1674136690_ens_usernamesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x7a, 0xf3, 0xa8, 0x88, 0x99, 0xd6, 0x9c, 0x69, 0x48, 0x3c, 0x10, 0xda, 0x72, 0xdc, 0x14, 0xd, 0x6e, 0x8c, 0x82, 0x92, 0x2d, 0x2c, 0xee, 0x4c, 0x70, 0xa4, 0xdc, 0x5c, 0x5, 0x2, 0xc3}} return a, nil } @@ -1033,7 +1033,7 @@ func _1674232431_add_balance_historyUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf7, 0xb5, 0x18, 0xca, 0x4a, 0x93, 0xbb, 0x6f, 0xa4, 0xee, 0xe4, 0x3e, 0xff, 0x6a, 0x4b, 0xe2, 0xe1, 0x61, 0x28, 0xee, 0xc5, 0x26, 0x57, 0x61, 0x5e, 0x6d, 0x44, 0x1e, 0x85, 0x43, 0x70, 0xa2}} return a, nil } @@ -1053,7 +1053,7 @@ func _1676368933_keypairs_to_keycardsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x93, 0x27, 0x2, 0xf0, 0x37, 0x81, 0x65, 0xa4, 0xb3, 0x5b, 0x60, 0x36, 0x95, 0xfc, 0x81, 0xf0, 0x3b, 0x7c, 0xc3, 0x2c, 0x85, 0xbd, 0x38, 0x46, 0xa4, 0x95, 0x4a, 0x6, 0x3e, 0x74, 0xd5}} return a, nil } @@ -1073,7 +1073,7 @@ func _1676951398_add_currency_format_cacheUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf9, 0xa3, 0x76, 0x35, 0xca, 0xf, 0xe8, 0xdf, 0xd9, 0x61, 0xf9, 0xed, 0xfc, 0x6d, 0xf5, 0xe, 0x11, 0x88, 0xbd, 0x14, 0x92, 0xc6, 0x57, 0x53, 0xe, 0xcd, 0x52, 0xf4, 0xa9, 0xb1, 0xdd, 0xfd}} return a, nil } @@ -1093,7 +1093,7 @@ func _1676968196_keycards_add_clock_columnUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xf, 0x1c, 0x28, 0x41, 0x57, 0x57, 0x6c, 0xe, 0x75, 0x6b, 0x75, 0x12, 0x0, 0x18, 0x1e, 0x88, 0x1e, 0x45, 0xe0, 0x32, 0xb9, 0xd4, 0xd9, 0x2e, 0xc8, 0xb, 0x80, 0x6, 0x51, 0x3d, 0x28}} return a, nil } @@ -1113,7 +1113,7 @@ func _1676968197_add_fallback_rpc_to_networksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0x6a, 0xc6, 0x45, 0xfa, 0x62, 0x84, 0x74, 0x6d, 0x7c, 0xd7, 0x1d, 0x79, 0xb6, 0x38, 0x43, 0xa8, 0x8, 0x6b, 0x75, 0x3d, 0x9, 0x2, 0xc5, 0x9f, 0xbb, 0x45, 0x56, 0x4c, 0x4e, 0x17, 0x89}} return a, nil } @@ -1133,7 +1133,7 @@ func _1677674090_add_chains_ens_istest_to_saved_addressesUpSql() (*asset, error) return nil, err } - info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x2d, 0xa4, 0x1b, 0xf6, 0x6a, 0x13, 0x7b, 0xe, 0x59, 0xcd, 0xe2, 0x4e, 0x81, 0x99, 0xc4, 0x33, 0x84, 0xde, 0x66, 0xca, 0xac, 0x2f, 0x5, 0x90, 0xac, 0xfd, 0x4e, 0xfc, 0x55, 0x44, 0xe5}} return a, nil } @@ -1153,7 +1153,7 @@ func _1677681143_accounts_table_type_column_updateUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0xc4, 0x6, 0x42, 0x50, 0x1d, 0xf4, 0x48, 0x55, 0xbc, 0xa2, 0x19, 0xdd, 0xad, 0xc8, 0xc, 0xa7, 0x30, 0xb6, 0xaf, 0xe, 0x2b, 0xaa, 0x2a, 0xa4, 0xe1, 0xb9, 0x41, 0x23, 0x66, 0xd3, 0x3}} return a, nil } @@ -1173,7 +1173,7 @@ func _1678264207_accounts_table_new_columns_addedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xd4, 0xf3, 0x35, 0xef, 0x5c, 0x19, 0x3c, 0x15, 0x90, 0x60, 0xbd, 0x1f, 0x81, 0xf0, 0x86, 0x73, 0x89, 0xa0, 0x70, 0xf2, 0x46, 0xae, 0xea, 0xd0, 0xc6, 0x9e, 0x55, 0x4a, 0x54, 0x62, 0xbb}} return a, nil } @@ -1193,7 +1193,7 @@ func _1680770368_add_bio_to_settings_sync_clock_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4a, 0x52, 0xf6, 0x3f, 0xaa, 0xd, 0xa0, 0xee, 0xe8, 0xe6, 0x16, 0x21, 0x80, 0x61, 0xe4, 0x7a, 0x4e, 0x37, 0x8d, 0x30, 0x51, 0x20, 0x4d, 0x15, 0x47, 0xfb, 0x6, 0xa1, 0xce, 0xc8, 0x27, 0x5a}} return a, nil } @@ -1213,7 +1213,7 @@ func _1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql() (*asset, error return nil, err } - info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3d, 0x74, 0x81, 0x7d, 0x9e, 0x77, 0xb6, 0xfe, 0xe3, 0xcb, 0x48, 0xe5, 0x5f, 0x39, 0x23, 0xa1, 0x7d, 0x53, 0x22, 0xe8, 0x96, 0x15, 0x8a, 0x1e, 0x8e, 0xbc, 0xe2, 0x1d, 0xc4, 0xc2, 0x56, 0x34}} return a, nil } @@ -1233,7 +1233,7 @@ func _1681392602_9d_sync_periodUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0xa, 0x90, 0x29, 0x7f, 0x76, 0x98, 0xa7, 0x71, 0x80, 0x5a, 0x2f, 0xbe, 0x23, 0x9a, 0xd4, 0xf4, 0x39, 0x19, 0xd3, 0xa5, 0x34, 0x6e, 0x67, 0x6a, 0xbe, 0x8a, 0xad, 0x21, 0xc7, 0xba, 0x88}} return a, nil } @@ -1253,7 +1253,7 @@ func _1681762078_default_sync_period_9dUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xd9, 0x26, 0xfc, 0xa9, 0x45, 0xc1, 0x81, 0xa8, 0xe2, 0x2c, 0xe9, 0x3c, 0xea, 0x1d, 0x37, 0x11, 0x45, 0x8c, 0x6c, 0xbc, 0xc2, 0x6, 0x69, 0x2, 0x75, 0x29, 0x40, 0x9f, 0xc5, 0xbb, 0x36}} return a, nil } @@ -1273,7 +1273,7 @@ func _1681780680_add_clock_to_social_links_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x63, 0x11, 0xf5, 0x41, 0xe5, 0x5a, 0xf4, 0xe3, 0xf3, 0x14, 0x87, 0x28, 0xd8, 0xf0, 0x52, 0x31, 0x8, 0xd5, 0xbb, 0xf4, 0xff, 0x55, 0x5f, 0x42, 0x90, 0xcb, 0xf7, 0x46, 0x2, 0x6, 0xbe, 0x42}} return a, nil } @@ -1293,7 +1293,7 @@ func _1682073779_settings_table_remove_latest_derived_path_columnUpSql() (*asset return nil, err } - info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0x36, 0x2, 0x41, 0xd, 0x5c, 0xd1, 0x92, 0x85, 0x6d, 0x84, 0xff, 0x67, 0xa7, 0x4c, 0x67, 0xa4, 0xef, 0x52, 0x69, 0x1f, 0x22, 0x25, 0x92, 0xc, 0xb3, 0x89, 0x50, 0x91, 0xc, 0x49, 0xf9}} return a, nil } @@ -1313,7 +1313,7 @@ func _1682146075_add_created_at_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x88, 0xfe, 0x35, 0x9c, 0x6b, 0xdf, 0x67, 0x18, 0x16, 0xe4, 0xc9, 0xd4, 0x77, 0x7c, 0x4, 0xe2, 0x6c, 0x41, 0xd9, 0x53, 0x97, 0xfe, 0x5, 0xa3, 0x23, 0xce, 0x82, 0xad, 0x92, 0x5e, 0xd7, 0x7d}} return a, nil } @@ -1333,7 +1333,7 @@ func _1682393575_sync_ens_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfb, 0xea, 0xcb, 0x4d, 0x71, 0x5a, 0x49, 0x19, 0x8b, 0xef, 0x66, 0x27, 0x33, 0x89, 0xb0, 0xe, 0x37, 0x1b, 0x41, 0x8, 0x12, 0xcc, 0x56, 0xd8, 0x1b, 0xf, 0xf8, 0x50, 0x4b, 0x93, 0xf1, 0x29}} return a, nil } @@ -1353,7 +1353,7 @@ func _1683457503_add_blocks_ranges_sequential_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfe, 0x57, 0x2e, 0x0, 0x6a, 0x6e, 0xd7, 0xeb, 0xe6, 0x66, 0x79, 0x32, 0x22, 0x82, 0x92, 0xf4, 0xc9, 0xf1, 0x58, 0x1a, 0x45, 0x60, 0x77, 0x50, 0xe7, 0x54, 0x4a, 0xc0, 0x42, 0x3a, 0x4f, 0x35}} return a, nil } @@ -1373,7 +1373,7 @@ func _1683627613_accounts_and_keycards_improvementsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xbe, 0x62, 0xf5, 0x9, 0x42, 0x8c, 0x8f, 0xa8, 0x45, 0xe7, 0x36, 0xc9, 0xde, 0xf4, 0xe2, 0xfd, 0xc4, 0x8, 0xd0, 0xa3, 0x8, 0x64, 0xe2, 0x56, 0xcc, 0xa7, 0x6d, 0xc5, 0xcc, 0x82, 0x2c}} return a, nil } @@ -1393,7 +1393,7 @@ func _1685041348_settings_table_add_latest_derived_path_columnUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xd4, 0x1b, 0xbf, 0x8, 0xf9, 0xd4, 0xb0, 0xa0, 0x6, 0x5b, 0xfb, 0x7e, 0xff, 0xfa, 0xbf, 0xcc, 0x64, 0x47, 0x81, 0x8b, 0x5e, 0x17, 0x6a, 0xa7, 0xa4, 0x35, 0x8f, 0x30, 0x4f, 0xd9, 0xd}} return a, nil } @@ -1413,7 +1413,7 @@ func _1685440989_update_color_id_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0644), modTime: time.Unix(1686056653, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0x2e, 0x51, 0x1d, 0x2d, 0x16, 0x84, 0xd6, 0xe8, 0xbc, 0x20, 0x53, 0x47, 0xb8, 0x40, 0x21, 0x52, 0x5c, 0xd9, 0xbb, 0xea, 0xe2, 0xa5, 0x77, 0xc8, 0x35, 0x4c, 0xe0, 0x9d, 0x42, 0x44, 0x50}} return a, nil } @@ -1433,7 +1433,7 @@ func _1685463947_add_to_asset_to_multitransactionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0664), modTime: time.Unix(1686055512, 0)} + info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1686056653, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0x66, 0x15, 0x10, 0xfa, 0x66, 0x81, 0x68, 0xd9, 0xb4, 0x93, 0x9e, 0x11, 0xed, 0x1d, 0x16, 0x9d, 0x5a, 0xf8, 0xd7, 0x8, 0xea, 0x7a, 0xaf, 0xe4, 0xb3, 0x22, 0x19, 0xca, 0xff, 0x75, 0x7c}} return a, nil } @@ -1453,7 +1453,7 @@ func _1685880973_add_profile_links_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0664), modTime: time.Unix(1686055512, 0)} + info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0644), modTime: time.Unix(1686147344, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x13, 0x23, 0x7b, 0x1e, 0x82, 0x61, 0xcc, 0x76, 0xd6, 0xc7, 0x42, 0x6e, 0x69, 0x21, 0x1b, 0xfd, 0x7d, 0xda, 0xd7, 0xb7, 0xc7, 0xd3, 0x22, 0x63, 0xfe, 0xc6, 0xd3, 0xdf, 0xc8, 0x5f, 0x50, 0xcc}} return a, nil } @@ -1473,7 +1473,7 @@ func _1686041510_add_idx_transfers_blkno_loadedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0664), modTime: time.Unix(1686055512, 0)} + info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1686147344, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe2, 0x5d, 0x7e, 0x43, 0x14, 0x3c, 0x50, 0x44, 0x25, 0xd0, 0xe1, 0x75, 0xba, 0x61, 0x7b, 0x68, 0x2e, 0x43, 0x74, 0x1d, 0x10, 0x61, 0x8e, 0x45, 0xe6, 0x25, 0x78, 0x81, 0x68, 0x6, 0x24, 0x5b}} return a, nil } @@ -1493,7 +1493,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0664), modTime: time.Unix(1686557105, 0)} + info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1686642106, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x6c, 0xd9, 0x76, 0x83, 0x64, 0xf0, 0xf2, 0x74, 0x97, 0xca, 0xd7, 0xaa, 0x4, 0x74, 0x7c, 0x34, 0x56, 0x88, 0x10, 0xa9, 0x4d, 0x1d, 0x8e, 0x85, 0xc3, 0x66, 0x1, 0x2b, 0x30, 0x90, 0xf4}} return a, nil } @@ -1513,7 +1513,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0664), modTime: time.Unix(1686557105, 0)} + info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0644), modTime: time.Unix(1686642106, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0xcd, 0xe3, 0xa6, 0x8c, 0x53, 0x51, 0xe6, 0x3c, 0x64, 0xcb, 0x3, 0x3, 0xb, 0x4d, 0x52, 0xa5, 0x1c, 0xcc, 0xe1, 0x23, 0x94, 0x14, 0x79, 0xd7, 0x56, 0x58, 0xef, 0xcc, 0x1a, 0x6, 0xa4}} return a, nil } @@ -1533,7 +1533,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}} return a, nil } diff --git a/appdatabase/migrationsprevnodecfg/bindata.go b/appdatabase/migrationsprevnodecfg/bindata.go index 21f4e8f1a..0493e5e14 100644 --- a/appdatabase/migrationsprevnodecfg/bindata.go +++ b/appdatabase/migrationsprevnodecfg/bindata.go @@ -137,7 +137,7 @@ func _0001_appDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_app.down.sql", size: 356, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0001_app.down.sql", size: 356, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb5, 0x25, 0xa0, 0xf8, 0x7d, 0x2d, 0xd, 0xcf, 0x18, 0xe4, 0x73, 0xc3, 0x95, 0xf5, 0x24, 0x20, 0xa9, 0xe6, 0x9e, 0x1d, 0x93, 0xe5, 0xc5, 0xad, 0x93, 0x8f, 0x5e, 0x40, 0xb5, 0x30, 0xaa, 0x25}} return a, nil } @@ -157,7 +157,7 @@ func _0001_appUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_app.up.sql", size: 2967, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0001_app.up.sql", size: 2967, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf7, 0x3a, 0xa7, 0xf2, 0x8f, 0xfa, 0x82, 0x7c, 0xc5, 0x49, 0xac, 0xac, 0xf, 0xc, 0x77, 0xe2, 0xba, 0xe8, 0x4d, 0xe, 0x6f, 0x5d, 0x2c, 0x2c, 0x18, 0x80, 0xc2, 0x1d, 0xe, 0x25, 0xe, 0x18}} return a, nil } @@ -177,7 +177,7 @@ func _0002_tokensDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0002_tokens.down.sql", size: 19, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0002_tokens.down.sql", size: 19, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0x31, 0x2, 0xcc, 0x2f, 0x38, 0x90, 0xf7, 0x58, 0x37, 0x47, 0xf4, 0x18, 0xf7, 0x72, 0x74, 0x67, 0x14, 0x7e, 0xf3, 0xb1, 0xd6, 0x5f, 0xb0, 0xd5, 0xe7, 0x91, 0xf4, 0x26, 0x77, 0x8e, 0x68}} return a, nil } @@ -197,7 +197,7 @@ func _0002_tokensUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0002_tokens.up.sql", size: 248, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0002_tokens.up.sql", size: 248, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcc, 0xd6, 0xde, 0xd3, 0x7b, 0xee, 0x92, 0x11, 0x38, 0xa4, 0xeb, 0x84, 0xca, 0xcb, 0x37, 0x75, 0x5, 0x77, 0x7f, 0x14, 0x39, 0xee, 0xa1, 0x8b, 0xd4, 0x5c, 0x6e, 0x55, 0x6, 0x50, 0x16, 0xd4}} return a, nil } @@ -217,7 +217,7 @@ func _0003_settingsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0003_settings.down.sql", size: 118, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0003_settings.down.sql", size: 118, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe5, 0xa6, 0xf5, 0xc0, 0x60, 0x64, 0x77, 0xe2, 0xe7, 0x3c, 0x9b, 0xb1, 0x52, 0xa9, 0x95, 0x16, 0xf8, 0x60, 0x2f, 0xa5, 0xeb, 0x46, 0xb9, 0xb9, 0x8f, 0x4c, 0xf4, 0xfd, 0xbb, 0xe7, 0xe5, 0xe5}} return a, nil } @@ -237,7 +237,7 @@ func _0003_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0003_settings.up.sql", size: 1311, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0003_settings.up.sql", size: 1311, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x35, 0x0, 0xeb, 0xe2, 0x33, 0x68, 0xb9, 0xf4, 0xf6, 0x8e, 0x9e, 0x10, 0xe9, 0x58, 0x68, 0x28, 0xb, 0xcd, 0xec, 0x74, 0x71, 0xa7, 0x9a, 0x5a, 0x77, 0x59, 0xb1, 0x13, 0x1c, 0xa1, 0x5b}} return a, nil } @@ -257,7 +257,7 @@ func _0004_pending_stickersDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0004_pending_stickers.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0004_pending_stickers.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -277,7 +277,7 @@ func _0004_pending_stickersUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0004_pending_stickers.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0004_pending_stickers.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3c, 0xed, 0x25, 0xdf, 0x75, 0x2, 0x6c, 0xf0, 0xa2, 0xa8, 0x37, 0x62, 0x65, 0xad, 0xfd, 0x98, 0xa0, 0x9d, 0x63, 0x94, 0xdf, 0x6b, 0x46, 0xe0, 0x68, 0xec, 0x9c, 0x7f, 0x77, 0xdd, 0xb3, 0x6}} return a, nil } @@ -297,7 +297,7 @@ func _0005_waku_modeDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0005_waku_mode.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0005_waku_mode.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -317,7 +317,7 @@ func _0005_waku_modeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0005_waku_mode.up.sql", size: 146, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0005_waku_mode.up.sql", size: 146, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa6, 0x91, 0xc, 0xd7, 0x89, 0x61, 0x2e, 0x4c, 0x5a, 0xb6, 0x67, 0xd1, 0xc1, 0x42, 0x24, 0x38, 0xd6, 0x1b, 0x75, 0x41, 0x9c, 0x23, 0xb0, 0xca, 0x5c, 0xf1, 0x5c, 0xd0, 0x13, 0x92, 0x3e, 0xe1}} return a, nil } @@ -337,7 +337,7 @@ func _0006_appearanceUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0006_appearance.up.sql", size: 67, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0006_appearance.up.sql", size: 67, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xae, 0x6, 0x25, 0x6c, 0xe4, 0x9d, 0xa7, 0x72, 0xe8, 0xbc, 0xe4, 0x1f, 0x1e, 0x2d, 0x7c, 0xb7, 0xf6, 0xa3, 0xec, 0x3b, 0x4e, 0x93, 0x2e, 0xa4, 0xec, 0x6f, 0xe5, 0x95, 0x94, 0xe8, 0x4, 0xfb}} return a, nil } @@ -357,7 +357,7 @@ func _0007_enable_waku_defaultUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0007_enable_waku_default.up.sql", size: 38, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0007_enable_waku_default.up.sql", size: 38, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd4, 0x42, 0xb6, 0xe5, 0x48, 0x41, 0xeb, 0xc0, 0x7e, 0x3b, 0xe6, 0x8e, 0x96, 0x33, 0x20, 0x92, 0x24, 0x5a, 0x60, 0xfa, 0xa0, 0x3, 0x5e, 0x76, 0x4b, 0x89, 0xaa, 0x37, 0x66, 0xbc, 0x26, 0x11}} return a, nil } @@ -377,7 +377,7 @@ func _0008_add_push_notificationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0008_add_push_notifications.up.sql", size: 349, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0008_add_push_notifications.up.sql", size: 349, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5a, 0x0, 0xbf, 0xd0, 0xdd, 0xcd, 0x73, 0xe0, 0x7c, 0x56, 0xef, 0xdc, 0x57, 0x61, 0x94, 0x64, 0x70, 0xb9, 0xfa, 0xa1, 0x2a, 0x36, 0xc, 0x2f, 0xf8, 0x95, 0xa, 0x57, 0x3e, 0x7a, 0xd7, 0x12}} return a, nil } @@ -397,7 +397,7 @@ func _0009_enable_sending_push_notificationsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0009_enable_sending_push_notifications.down.sql", size: 49, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0009_enable_sending_push_notifications.down.sql", size: 49, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe9, 0xae, 0x1b, 0x41, 0xcb, 0x9c, 0x2c, 0x93, 0xc6, 0x2a, 0x77, 0x3, 0xb9, 0x51, 0xe0, 0x68, 0x68, 0x0, 0xf7, 0x5b, 0xb3, 0x1e, 0x94, 0x44, 0xba, 0x9c, 0xd0, 0x3b, 0x80, 0x21, 0x6f, 0xb5}} return a, nil } @@ -417,7 +417,7 @@ func _0009_enable_sending_push_notificationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0009_enable_sending_push_notifications.up.sql", size: 49, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0009_enable_sending_push_notifications.up.sql", size: 49, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1b, 0x80, 0xe4, 0x9c, 0xc8, 0xb8, 0xd5, 0xef, 0xce, 0x74, 0x9b, 0x7b, 0xdd, 0xa, 0x99, 0x1e, 0xef, 0x7f, 0xb8, 0x99, 0x84, 0x4, 0x0, 0x6b, 0x1d, 0x2c, 0xa, 0xf8, 0x2c, 0x4f, 0xb5, 0x44}} return a, nil } @@ -437,7 +437,7 @@ func _0010_add_block_mentionsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0010_add_block_mentions.down.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0010_add_block_mentions.down.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6d, 0x9e, 0x27, 0x1e, 0xba, 0x9f, 0xca, 0xae, 0x98, 0x2e, 0x6e, 0xe3, 0xdd, 0xac, 0x73, 0x34, 0x4e, 0x69, 0x92, 0xb5, 0xf6, 0x9, 0xab, 0x50, 0x35, 0xd, 0xee, 0xeb, 0x3e, 0xcc, 0x7e, 0xce}} return a, nil } @@ -457,7 +457,7 @@ func _0010_add_block_mentionsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0010_add_block_mentions.up.sql", size: 89, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0010_add_block_mentions.up.sql", size: 89, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd7, 0x23, 0x85, 0xa2, 0xb5, 0xb6, 0xb4, 0x3f, 0xdc, 0x4e, 0xff, 0xe2, 0x6b, 0x66, 0x68, 0x5e, 0xb2, 0xb4, 0x14, 0xb2, 0x1b, 0x4d, 0xb1, 0xce, 0xf7, 0x6, 0x58, 0xa7, 0xaf, 0x93, 0x3f, 0x25}} return a, nil } @@ -477,7 +477,7 @@ func _0011_allow_webview_permission_requestsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0011_allow_webview_permission_requests.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0011_allow_webview_permission_requests.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -497,7 +497,7 @@ func _0011_allow_webview_permission_requestsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0011_allow_webview_permission_requests.up.sql", size: 88, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0011_allow_webview_permission_requests.up.sql", size: 88, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x43, 0x5f, 0x22, 0x4c, 0x98, 0x1d, 0xc6, 0xf4, 0x89, 0xaf, 0xf4, 0x44, 0xba, 0xf8, 0x28, 0xa7, 0xb5, 0xb9, 0xf0, 0xf2, 0xcb, 0x5, 0x59, 0x7a, 0xc, 0xdf, 0xd3, 0x38, 0xa4, 0xb8, 0x98, 0xc2}} return a, nil } @@ -517,7 +517,7 @@ func _0012_pending_transactionsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0012_pending_transactions.down.sql", size: 33, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0012_pending_transactions.down.sql", size: 33, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0x41, 0xfe, 0x5c, 0xd8, 0xc3, 0x29, 0xfd, 0x31, 0x78, 0x99, 0x7a, 0xeb, 0x17, 0x62, 0x88, 0x41, 0xb3, 0xe7, 0xb5, 0x5, 0x0, 0x90, 0xa1, 0x7, 0x1a, 0x23, 0x88, 0x81, 0xba, 0x56, 0x9d}} return a, nil } @@ -537,7 +537,7 @@ func _0012_pending_transactionsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0012_pending_transactions.up.sql", size: 321, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0012_pending_transactions.up.sql", size: 321, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd, 0x17, 0xff, 0xd7, 0xa7, 0x49, 0x1e, 0x7b, 0x34, 0x63, 0x7c, 0x53, 0xaa, 0x6b, 0x2d, 0xc8, 0xe0, 0x82, 0x21, 0x90, 0x3a, 0x94, 0xf1, 0xa6, 0xe4, 0x70, 0xe5, 0x85, 0x1a, 0x48, 0x25, 0xb}} return a, nil } @@ -557,7 +557,7 @@ func _0013_favouritesDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0013_favourites.down.sql", size: 23, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0013_favourites.down.sql", size: 23, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x32, 0xf8, 0x55, 0x13, 0x4f, 0x4a, 0x19, 0x83, 0x9c, 0xda, 0x34, 0xb8, 0x3, 0x54, 0x82, 0x1e, 0x99, 0x36, 0x6b, 0x42, 0x3, 0xf6, 0x43, 0xde, 0xe6, 0x32, 0xb6, 0xdf, 0xe2, 0x59, 0x8c, 0x84}} return a, nil } @@ -577,7 +577,7 @@ func _0013_favouritesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0013_favourites.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0013_favourites.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbe, 0x1, 0x27, 0x38, 0x76, 0xf5, 0xcb, 0x61, 0xda, 0x5b, 0xce, 0xd9, 0x8b, 0x18, 0x77, 0x61, 0x84, 0xe7, 0x22, 0xe2, 0x13, 0x99, 0xab, 0x32, 0xbc, 0xbe, 0xed, 0x1f, 0x2f, 0xb0, 0xe4, 0x8d}} return a, nil } @@ -597,7 +597,7 @@ func _0014_add_use_mailserversDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0014_add_use_mailservers.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0014_add_use_mailservers.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -617,7 +617,7 @@ func _0014_add_use_mailserversUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0014_add_use_mailservers.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0014_add_use_mailservers.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0xba, 0x65, 0xbf, 0x1b, 0xc9, 0x6d, 0x45, 0xf2, 0xf5, 0x30, 0x7c, 0xc1, 0xde, 0xb8, 0xe3, 0x3f, 0xa9, 0x2f, 0x9f, 0xea, 0x1, 0x29, 0x29, 0x65, 0xe7, 0x38, 0xab, 0xa4, 0x62, 0xf, 0xd0}} return a, nil } @@ -637,7 +637,7 @@ func _0015_link_previewsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0015_link_previews.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0015_link_previews.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -657,7 +657,7 @@ func _0015_link_previewsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0015_link_previews.up.sql", size: 203, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0015_link_previews.up.sql", size: 203, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb1, 0xf7, 0x38, 0x25, 0xa6, 0xfc, 0x6b, 0x9, 0xe4, 0xd9, 0xbf, 0x58, 0x7b, 0x80, 0xd8, 0x48, 0x63, 0xde, 0xa5, 0x5e, 0x30, 0xa3, 0xeb, 0x68, 0x8e, 0x6a, 0x9f, 0xfd, 0xf4, 0x46, 0x41, 0x34}} return a, nil } @@ -677,7 +677,7 @@ func _0016_local_notifications_preferencesDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0016_local_notifications_preferences.down.sql", size: 43, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0016_local_notifications_preferences.down.sql", size: 43, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe0, 0x50, 0xc7, 0xdd, 0x53, 0x9c, 0x5d, 0x1e, 0xb5, 0x71, 0x25, 0x50, 0x58, 0xcf, 0x6d, 0xbe, 0x5a, 0x8, 0x12, 0xc9, 0x13, 0xd, 0x9a, 0x3d, 0x4b, 0x7a, 0x2f, 0x1b, 0xe5, 0x23, 0x52, 0x78}} return a, nil } @@ -697,7 +697,7 @@ func _0016_local_notifications_preferencesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0016_local_notifications_preferences.up.sql", size: 204, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0016_local_notifications_preferences.up.sql", size: 204, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3f, 0x3a, 0x16, 0x25, 0xdf, 0xba, 0x62, 0xd3, 0x81, 0x73, 0xc, 0x10, 0x85, 0xbc, 0x8d, 0xe, 0x1d, 0x62, 0xcb, 0xb, 0x6d, 0x8c, 0x4f, 0x63, 0x5f, 0xe2, 0xd, 0xc5, 0x46, 0xa8, 0x35, 0x5b}} return a, nil } @@ -717,7 +717,7 @@ func _0017_bookmarksDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0017_bookmarks.down.sql", size: 22, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0017_bookmarks.down.sql", size: 22, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9a, 0x13, 0x2a, 0x44, 0xb0, 0x3, 0x18, 0x63, 0xb8, 0x33, 0xda, 0x3a, 0xeb, 0xb8, 0xcb, 0xd1, 0x98, 0x29, 0xa7, 0xf0, 0x6, 0x9d, 0xc9, 0x62, 0xe7, 0x89, 0x7f, 0x77, 0xaf, 0xec, 0x6b, 0x8f}} return a, nil } @@ -737,7 +737,7 @@ func _0017_bookmarksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0017_bookmarks.up.sql", size: 147, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0017_bookmarks.up.sql", size: 147, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbc, 0x47, 0xe1, 0xe3, 0xd8, 0xc6, 0x4, 0x6d, 0x5f, 0x2f, 0xa, 0x51, 0xa6, 0x8c, 0x6a, 0xe0, 0x3d, 0x8c, 0x91, 0x47, 0xbc, 0x1, 0x75, 0x46, 0x92, 0x2, 0x18, 0x6e, 0xe3, 0x4f, 0x18, 0x57}} return a, nil } @@ -757,7 +757,7 @@ func _0018_profile_pictures_visibilityUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0018_profile_pictures_visibility.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0018_profile_pictures_visibility.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0xe3, 0xc5, 0xec, 0x83, 0x55, 0x45, 0x57, 0x7a, 0xaa, 0xd2, 0xa7, 0x59, 0xa7, 0x87, 0xef, 0x63, 0x19, 0x9c, 0x46, 0x9c, 0xc5, 0x32, 0x89, 0xa4, 0x68, 0x70, 0xd8, 0x83, 0x43, 0xa4, 0x72}} return a, nil } @@ -777,7 +777,7 @@ func _0019_blocks_ranges_extra_dataUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0019_blocks_ranges_extra_data.up.sql", size: 89, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0019_blocks_ranges_extra_data.up.sql", size: 89, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa3, 0x96, 0x32, 0x58, 0xf0, 0xb9, 0xe1, 0x70, 0x81, 0xca, 0x8d, 0x45, 0x57, 0x8a, 0x7, 0x5d, 0x9e, 0x2a, 0x30, 0xb, 0xad, 0x5f, 0xf8, 0xd4, 0x30, 0x94, 0x73, 0x37, 0x8d, 0xc1, 0x9a, 0xed}} return a, nil } @@ -797,7 +797,7 @@ func _0020_metricsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0020_metrics.up.sql", size: 235, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0020_metrics.up.sql", size: 235, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe8, 0x32, 0xbc, 0xb6, 0x9b, 0x5a, 0x8f, 0x9f, 0x4c, 0x90, 0x81, 0x3e, 0x2e, 0xd1, 0x23, 0xcd, 0xf1, 0x83, 0x35, 0xca, 0x66, 0x87, 0x52, 0x4e, 0x30, 0x3e, 0x4f, 0xa8, 0xfd, 0x30, 0x16, 0xbd}} return a, nil } @@ -817,7 +817,7 @@ func _0021_add_session_id_to_metricsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0021_add_session_id_to_metrics.up.sql", size: 55, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0021_add_session_id_to_metrics.up.sql", size: 55, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x81, 0xfc, 0x97, 0xd1, 0x8b, 0xea, 0x8e, 0xd7, 0xc2, 0x53, 0x62, 0xe9, 0xbc, 0xf, 0x8c, 0x46, 0x41, 0x41, 0xb7, 0x6, 0x35, 0xf5, 0xba, 0xbb, 0x28, 0x50, 0x48, 0xbf, 0x36, 0x90, 0x5c}} return a, nil } @@ -837,7 +837,7 @@ func _0022_pending_transfersUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0022_pending_transfers.up.sql", size: 706, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "0022_pending_transfers.up.sql", size: 706, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6a, 0x9, 0xe6, 0x6, 0xae, 0x60, 0xdd, 0xbb, 0x76, 0xac, 0xe0, 0x57, 0x30, 0x67, 0x37, 0x93, 0x40, 0x13, 0xec, 0xf2, 0x6e, 0x61, 0xa, 0x14, 0xb2, 0xb1, 0xbd, 0x91, 0xf8, 0x89, 0xb3, 0xe3}} return a, nil } @@ -857,7 +857,7 @@ func _1618237885_settings_anon_metrics_should_sendUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1618237885_settings_anon_metrics_should_send.up.sql", size: 80, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1618237885_settings_anon_metrics_should_send.up.sql", size: 80, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x6c, 0x1d, 0x1f, 0x54, 0x62, 0x18, 0x22, 0x5c, 0xa7, 0x8c, 0x59, 0x24, 0xd3, 0x4d, 0x55, 0xc4, 0x2a, 0x9e, 0x4c, 0x37, 0x6b, 0xfd, 0xac, 0xec, 0xb7, 0x68, 0x21, 0x26, 0x26, 0xf3, 0x92}} return a, nil } @@ -877,7 +877,7 @@ func _1618395756_contacts_onlyUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1618395756_contacts_only.up.sql", size: 136, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1618395756_contacts_only.up.sql", size: 136, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0xe3, 0xd0, 0xe7, 0xf2, 0x6e, 0xbf, 0x27, 0xf6, 0xe2, 0x2e, 0x16, 0x4b, 0x52, 0x3b, 0xcf, 0x63, 0x52, 0xfc, 0x1d, 0x43, 0xba, 0x42, 0xf9, 0x1e, 0x1e, 0x39, 0x40, 0xed, 0x0, 0x20, 0xa8}} return a, nil } @@ -897,7 +897,7 @@ func _1622184614_add_default_sync_periodUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1622184614_add_default_sync_period.up.sql", size: 125, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1622184614_add_default_sync_period.up.sql", size: 125, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x60, 0x39, 0xeb, 0x8f, 0xdc, 0x1, 0x56, 0xc1, 0x9b, 0xaa, 0xda, 0x44, 0xe0, 0xdb, 0xda, 0x2c, 0xe7, 0x71, 0x8d, 0xbc, 0xc1, 0x9a, 0x4f, 0x48, 0xe0, 0x5e, 0x81, 0x1e, 0x8e, 0x6a, 0x4d, 0x3}} return a, nil } @@ -917,7 +917,7 @@ func _1625872445_user_statusUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1625872445_user_status.up.sql", size: 351, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1625872445_user_status.up.sql", size: 351, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0xa, 0xfe, 0x7a, 0xcc, 0x9e, 0x35, 0x26, 0xb, 0xc8, 0xf2, 0x7d, 0xfa, 0x4b, 0xcf, 0x53, 0x20, 0x76, 0xc7, 0xd, 0xbc, 0x78, 0x4f, 0x74, 0x2d, 0x2e, 0x2e, 0x7e, 0x62, 0xae, 0x78, 0x1f}} return a, nil } @@ -937,7 +937,7 @@ func _1627983977_add_gif_to_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1627983977_add_gif_to_settings.up.sql", size: 102, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1627983977_add_gif_to_settings.up.sql", size: 102, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x63, 0xe6, 0xe1, 0x97, 0x64, 0x4c, 0xe2, 0x14, 0xb1, 0x96, 0x3a, 0xb0, 0xb9, 0xb7, 0xb5, 0x78, 0x4a, 0x39, 0x69, 0x89, 0xb7, 0x89, 0x19, 0xb8, 0x89, 0x1, 0xc5, 0xc2, 0x85, 0x53, 0xe2, 0x83}} return a, nil } @@ -957,7 +957,7 @@ func _1628580203_add_hidden_accountUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1628580203_add_hidden_account.up.sql", size: 67, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1628580203_add_hidden_account.up.sql", size: 67, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcb, 0x30, 0xf1, 0xd4, 0x60, 0xe2, 0x28, 0x14, 0xcb, 0x16, 0xb, 0x9, 0xea, 0x17, 0xa, 0x9e, 0x89, 0xa8, 0x32, 0x32, 0xf8, 0x4d, 0xa0, 0xe1, 0xe5, 0x79, 0xbd, 0x7d, 0x79, 0xe9, 0x4c, 0x9e}} return a, nil } @@ -977,7 +977,7 @@ func _1629123384_add_id_to_app_metricsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1629123384_add_id_to_app_metrics.up.sql", size: 589, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1629123384_add_id_to_app_metrics.up.sql", size: 589, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdf, 0x66, 0xc0, 0x69, 0xb, 0xad, 0x49, 0x7c, 0x8c, 0x67, 0xb8, 0xd6, 0x8d, 0x5d, 0x86, 0x1f, 0xa4, 0x53, 0xf5, 0x8, 0x1, 0xfd, 0x38, 0x49, 0xee, 0x84, 0xc0, 0xd8, 0x17, 0x72, 0x3, 0xb3}} return a, nil } @@ -997,7 +997,7 @@ func _1630401853_add_opensea_enabled_to_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1630401853_add_opensea_enabled_to_settings.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1630401853_add_opensea_enabled_to_settings.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6, 0x91, 0x86, 0x15, 0xc8, 0x99, 0xe3, 0xae, 0xa, 0x6e, 0x94, 0x48, 0x51, 0x5b, 0x18, 0xe0, 0xbc, 0xaf, 0x34, 0x75, 0x55, 0x61, 0xd4, 0xc1, 0x85, 0xc7, 0x3d, 0x99, 0x9e, 0x1f, 0x37, 0x56}} return a, nil } @@ -1017,7 +1017,7 @@ func _1630464455_createSaved_addressesTableDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1630464455_create-saved_addresses-table.down.sql", size: 28, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1630464455_create-saved_addresses-table.down.sql", size: 28, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x23, 0x52, 0x39, 0xb5, 0x42, 0xac, 0xcb, 0xa1, 0x44, 0xb7, 0x94, 0x26, 0x24, 0xb2, 0x12, 0xc, 0xc5, 0xbf, 0x63, 0x13, 0x6f, 0x3c, 0x4, 0x7b, 0xf0, 0xd, 0xfa, 0x55, 0x9e, 0x51, 0xf9, 0x7a}} return a, nil } @@ -1037,7 +1037,7 @@ func _1630464455_createSaved_addressesTableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1630464455_create-saved_addresses-table.up.sql", size: 187, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1630464455_create-saved_addresses-table.up.sql", size: 187, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x32, 0xf, 0x56, 0x18, 0xeb, 0x4e, 0xac, 0xd8, 0xd6, 0x91, 0xae, 0x83, 0xcf, 0x91, 0x9e, 0x4, 0x4b, 0x2, 0x1f, 0x6d, 0xba, 0xf6, 0x3, 0xf2, 0x98, 0x72, 0xf6, 0x91, 0x29, 0x96, 0x0, 0x35}} return a, nil } @@ -1057,7 +1057,7 @@ func _1630485153_networksDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1630485153_networks.down.sql", size: 21, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1630485153_networks.down.sql", size: 21, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbb, 0x3e, 0x57, 0xb7, 0xf7, 0x8, 0xbd, 0xb5, 0xc2, 0xea, 0xc, 0x45, 0xb7, 0x7, 0x9, 0xca, 0xe7, 0x48, 0x7e, 0x56, 0x4e, 0x44, 0x78, 0x8e, 0xe3, 0x87, 0x63, 0xaf, 0x16, 0x3f, 0xf9, 0x71}} return a, nil } @@ -1077,7 +1077,7 @@ func _1630485153_networksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1630485153_networks.up.sql", size: 394, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1630485153_networks.up.sql", size: 394, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0x9, 0x1d, 0x3, 0x86, 0xbd, 0xc5, 0xde, 0x3c, 0x1b, 0x40, 0x41, 0x7c, 0x61, 0x8, 0x80, 0x53, 0x87, 0x1b, 0x5a, 0x56, 0xd, 0x88, 0x1d, 0x60, 0x24, 0xce, 0x7b, 0x8f, 0xff, 0xaf, 0x36}} return a, nil } @@ -1097,7 +1097,7 @@ func _1632262444_profile_pictures_show_toUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1632262444_profile_pictures_show_to.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1632262444_profile_pictures_show_to.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc3, 0xa2, 0x5a, 0x94, 0xde, 0x86, 0x2a, 0x29, 0xf5, 0xb3, 0x36, 0xe7, 0x53, 0x81, 0x55, 0xc9, 0xb5, 0xc3, 0xf4, 0x8c, 0x65, 0x2c, 0x4c, 0x48, 0xfd, 0x3c, 0xb7, 0x14, 0xb4, 0xea, 0x7a, 0x13}} return a, nil } @@ -1117,7 +1117,7 @@ func _1635942153_add_telemetry_server_url_to_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1635942153_add_telemetry_server_url_to_settings.up.sql", size: 128, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1635942153_add_telemetry_server_url_to_settings.up.sql", size: 128, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6e, 0x9b, 0x1d, 0x39, 0x9c, 0x8d, 0x50, 0x86, 0xdf, 0xe5, 0x81, 0x55, 0xdc, 0x31, 0xcd, 0xb7, 0xc7, 0x5a, 0x67, 0x3b, 0x21, 0x99, 0xa5, 0x74, 0xb8, 0xd3, 0x58, 0xae, 0x29, 0x68, 0x2a, 0x8d}} return a, nil } @@ -1137,7 +1137,7 @@ func _1635942154_add_backup_settingUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1635942154_add_backup_setting.up.sql", size: 287, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1635942154_add_backup_setting.up.sql", size: 287, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0xe7, 0xfb, 0x70, 0x80, 0x5, 0xb4, 0x7b, 0x67, 0x8, 0x6e, 0x5f, 0x45, 0x17, 0xd9, 0x5f, 0x18, 0x66, 0x2f, 0x8a, 0x4f, 0xd4, 0x15, 0xe5, 0x2b, 0xbb, 0x25, 0x7a, 0x30, 0xad, 0x4c, 0x1a}} return a, nil } @@ -1157,7 +1157,7 @@ func _1637745568_add_auto_message_settingUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1637745568_add_auto_message_setting.up.sql", size: 122, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1637745568_add_auto_message_setting.up.sql", size: 122, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1d, 0xd8, 0xd2, 0xc2, 0x3a, 0xd7, 0xf1, 0x96, 0x6a, 0x35, 0xe5, 0x5c, 0xb9, 0xed, 0x4b, 0xf2, 0x5f, 0x80, 0x43, 0xca, 0x40, 0x57, 0x7e, 0xd7, 0x41, 0x9f, 0x70, 0x9f, 0xaf, 0x2a, 0xfc, 0x8f}} return a, nil } @@ -1177,7 +1177,7 @@ func _1640111208_nodeconfigUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1640111208_nodeconfig.up.sql", size: 7659, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "1640111208_nodeconfig.up.sql", size: 7659, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0x5a, 0xc6, 0xed, 0x6, 0xcb, 0x51, 0x8b, 0x78, 0xe9, 0x10, 0x37, 0xd1, 0xad, 0x9b, 0x76, 0x9a, 0xb9, 0x72, 0x85, 0xe7, 0x8a, 0x7f, 0xf0, 0x81, 0xf8, 0x33, 0x59, 0x67, 0x8e, 0xeb, 0xb1}} return a, nil } @@ -1197,7 +1197,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 85, mode: os.FileMode(0644), modTime: time.Unix(1685543739, 0)} + info := bindataFileInfo{name: "doc.go", size: 85, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe5, 0xd2, 0xea, 0xc5, 0xd, 0xc4, 0x7f, 0x95, 0x8e, 0xd5, 0xf5, 0x96, 0xf2, 0x1b, 0xcb, 0xc7, 0xc2, 0x46, 0x1, 0x78, 0x1d, 0x5d, 0x59, 0x19, 0x99, 0xdd, 0x5b, 0xf5, 0x63, 0xa5, 0x25, 0xb8}} return a, nil } diff --git a/mailserver/migrations/bindata.go b/mailserver/migrations/bindata.go index 4b1c1b6fa..820ee73dc 100644 --- a/mailserver/migrations/bindata.go +++ b/mailserver/migrations/bindata.go @@ -86,7 +86,7 @@ func _1557732988_initialize_dbDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1557732988_initialize_db.down.sql", size: 72, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1557732988_initialize_db.down.sql", size: 72, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0x40, 0x78, 0xb7, 0x71, 0x3c, 0x20, 0x3b, 0xc9, 0xb, 0x2f, 0x49, 0xe4, 0xff, 0x1c, 0x84, 0x54, 0xa1, 0x30, 0xe3, 0x90, 0xf8, 0x73, 0xda, 0xb0, 0x2a, 0xea, 0x8e, 0xf1, 0x82, 0xe7, 0xd2}} return a, nil } @@ -106,7 +106,7 @@ func _1557732988_initialize_dbUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1557732988_initialize_db.up.sql", size: 278, mode: os.FileMode(0644), modTime: time.Unix(1632735704, 0)} + info := bindataFileInfo{name: "1557732988_initialize_db.up.sql", size: 278, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x85, 0x41, 0x7a, 0xba, 0x4f, 0xa3, 0x43, 0xc0, 0x63, 0xfa, 0x2c, 0xd1, 0xc5, 0xbb, 0x20, 0xa0, 0x64, 0xa8, 0x3b, 0x65, 0x82, 0xa2, 0x14, 0x28, 0x18, 0x7c, 0x8b, 0x3a, 0x7a, 0xfd, 0xe0}} return a, nil } @@ -126,7 +126,7 @@ func staticGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "static.go", size: 178, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "static.go", size: 178, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x8a, 0xf4, 0x27, 0x24, 0x9d, 0x2a, 0x1, 0x7b, 0x54, 0xea, 0xae, 0x4a, 0x35, 0x40, 0x92, 0xb5, 0xf9, 0xb3, 0x54, 0x3e, 0x3a, 0x1a, 0x2b, 0xae, 0xfb, 0x9e, 0x82, 0xeb, 0x4c, 0xf, 0x6}} return a, nil } diff --git a/multiaccounts/migrations/bindata.go b/multiaccounts/migrations/bindata.go index fd2001235..69bde8a34 100644 --- a/multiaccounts/migrations/bindata.go +++ b/multiaccounts/migrations/bindata.go @@ -95,7 +95,7 @@ func _0001_accountsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0x61, 0x4c, 0x18, 0xfc, 0xc, 0xdf, 0x5c, 0x1f, 0x5e, 0xd3, 0xbd, 0xfa, 0x12, 0x5e, 0x8d, 0x8d, 0x8b, 0xb9, 0x5f, 0x99, 0x46, 0x63, 0xa5, 0xe3, 0xa6, 0x8a, 0x4, 0xf1, 0x73, 0x8a, 0xe9}} return a, nil } @@ -115,7 +115,7 @@ func _0001_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf2, 0xfa, 0x99, 0x8e, 0x96, 0xb3, 0x13, 0x6c, 0x1f, 0x6, 0x27, 0xc5, 0xd2, 0xd4, 0xe0, 0xa5, 0x26, 0x82, 0xa7, 0x26, 0xf2, 0x68, 0x9d, 0xed, 0x9c, 0x3d, 0xbb, 0xdc, 0x37, 0x28, 0xbc, 0x1}} return a, nil } @@ -135,7 +135,7 @@ func _1605007189_identity_imagesDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(0644), modTime: time.Unix(1608652331, 0)} + info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2f, 0xcf, 0xa7, 0xae, 0xd5, 0x4f, 0xcd, 0x14, 0x63, 0x9, 0xbe, 0x39, 0x49, 0x18, 0x96, 0xb2, 0xa3, 0x8, 0x7d, 0x41, 0xdb, 0x50, 0x5d, 0xf5, 0x4d, 0xa2, 0xd, 0x8f, 0x57, 0x79, 0x77, 0x67}} return a, nil } @@ -155,7 +155,7 @@ func _1605007189_identity_imagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(0644), modTime: time.Unix(1608652331, 0)} + info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x50, 0xb6, 0xc1, 0x5c, 0x76, 0x72, 0x6b, 0x22, 0x34, 0xdc, 0x96, 0xdc, 0x2b, 0xfd, 0x2d, 0xbe, 0xcc, 0x1e, 0xd4, 0x5, 0x93, 0xd, 0xc2, 0x51, 0xf3, 0x1a, 0xef, 0x2b, 0x26, 0xa4, 0xeb, 0x65}} return a, nil } @@ -175,7 +175,7 @@ func _1606224181_drop_photo_path_from_accountsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(0644), modTime: time.Unix(1608652331, 0)} + info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x90, 0x24, 0x17, 0x7, 0x80, 0x93, 0x6f, 0x8d, 0x5d, 0xaa, 0x8c, 0x79, 0x15, 0x5d, 0xb3, 0x19, 0xd7, 0xd8, 0x39, 0xf9, 0x3a, 0x63, 0x8f, 0x81, 0x15, 0xb6, 0xd6, 0x9a, 0x37, 0xa8, 0x8e, 0x9b}} return a, nil } @@ -195,7 +195,7 @@ func _1606224181_drop_photo_path_from_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(0644), modTime: time.Unix(1608652331, 0)} + info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x4c, 0x97, 0xee, 0xef, 0x82, 0xb8, 0x6c, 0x71, 0xbb, 0x50, 0x7b, 0xe6, 0xd9, 0x22, 0x31, 0x7c, 0x1a, 0xfe, 0x91, 0x28, 0xf6, 0x6, 0x36, 0xe, 0xb1, 0xf1, 0xc8, 0x25, 0xac, 0x7e, 0xd6}} return a, nil } @@ -215,7 +215,7 @@ func _1648646095_image_clockDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1648646095_image_clock.down.sql", size: 939, mode: os.FileMode(0644), modTime: time.Unix(1684838089, 0)} + info := bindataFileInfo{name: "1648646095_image_clock.down.sql", size: 939, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4d, 0xa8, 0x1f, 0xf, 0xe0, 0xd7, 0xc9, 0x68, 0x98, 0xd8, 0x37, 0xb8, 0xba, 0x9e, 0xb2, 0x19, 0xf3, 0xc4, 0x73, 0x80, 0x3, 0x17, 0x2a, 0x53, 0x68, 0x10, 0x13, 0x54, 0x99, 0xb1, 0xf5, 0x1c}} return a, nil } @@ -235,7 +235,7 @@ func _1648646095_image_clockUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1648646095_image_clock.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1684838089, 0)} + info := bindataFileInfo{name: "1648646095_image_clock.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x98, 0xa6, 0xa4, 0x4e, 0x4e, 0xca, 0x17, 0x56, 0xea, 0xfb, 0xf0, 0xa9, 0x81, 0x95, 0xe, 0x80, 0x52, 0x1, 0x47, 0x9b, 0xde, 0x14, 0xfa, 0x72, 0xc9, 0x62, 0x6f, 0x24, 0xa2, 0xc, 0x32, 0x50}} return a, nil } @@ -255,7 +255,7 @@ func _1649317600_add_color_hashUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(0644), modTime: time.Unix(1669629376, 0)} + info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xf, 0x37, 0x6d, 0xcf, 0x99, 0xc9, 0x2e, 0xdc, 0x70, 0x11, 0xb4, 0x36, 0x26, 0x4f, 0x39, 0xa8, 0x44, 0xf, 0xcb, 0xcc, 0x81, 0x74, 0x7a, 0x88, 0xaa, 0x54, 0x8c, 0xc4, 0xe, 0x56, 0x4f}} return a, nil } @@ -275,7 +275,7 @@ func _1660238799_accounts_kdfUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660238799_accounts_kdf.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1684838089, 0)} + info := bindataFileInfo{name: "1660238799_accounts_kdf.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdf, 0xe6, 0x7a, 0x69, 0x25, 0x42, 0x3b, 0x9c, 0x20, 0xf5, 0xcb, 0xae, 0xb0, 0xb3, 0x1b, 0x66, 0xc2, 0x5d, 0xd0, 0xc1, 0x59, 0xe8, 0xa9, 0xc5, 0x69, 0x58, 0x8f, 0xae, 0xe6, 0xd1, 0x4c, 0x53}} return a, nil } @@ -295,7 +295,7 @@ func _1679505708_add_customization_colorUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1679505708_add_customization_color.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1684838089, 0)} + info := bindataFileInfo{name: "1679505708_add_customization_color.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0xe1, 0x3d, 0xaa, 0x5d, 0x35, 0x87, 0x8a, 0x8b, 0xe9, 0x4a, 0xa6, 0x7b, 0x85, 0xbc, 0x33, 0x11, 0xc7, 0x7d, 0x61, 0xac, 0x65, 0x59, 0xda, 0x32, 0x59, 0x68, 0x9d, 0xa1, 0x10, 0x7b, 0xa9}} return a, nil } @@ -315,7 +315,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}} return a, nil } diff --git a/protocol/anonmetrics/migrations/migrations.go b/protocol/anonmetrics/migrations/migrations.go index dc3df8009..842cb3267 100644 --- a/protocol/anonmetrics/migrations/migrations.go +++ b/protocol/anonmetrics/migrations/migrations.go @@ -86,7 +86,7 @@ func _1619446565_postgres_make_anon_metrics_tableDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1630503875, 0)} + info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x75, 0xea, 0x1, 0x74, 0xe6, 0xa3, 0x11, 0xd0, 0x86, 0x87, 0x7e, 0x31, 0xb4, 0x1a, 0x27, 0x5d, 0xda, 0x77, 0xa3, 0xf5, 0x1d, 0x88, 0x79, 0xcf, 0xd5, 0x95, 0x75, 0xd, 0x47, 0xa1, 0x90, 0x5}} return a, nil } @@ -106,7 +106,7 @@ func _1619446565_postgres_make_anon_metrics_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.up.sql", size: 443, mode: os.FileMode(0644), modTime: time.Unix(1630503875, 0)} + info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.up.sql", size: 443, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0xdc, 0x72, 0x28, 0x3c, 0xf6, 0x94, 0xb0, 0x47, 0x3d, 0xca, 0x55, 0x3d, 0xf7, 0x83, 0xb8, 0x7d, 0x2f, 0x1e, 0x98, 0xb7, 0xde, 0xa, 0xff, 0xa0, 0x52, 0x60, 0x83, 0x56, 0xc5, 0xd1, 0xa2}} return a, nil } @@ -126,7 +126,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 380, mode: os.FileMode(0644), modTime: time.Unix(1630503875, 0)} + info := bindataFileInfo{name: "doc.go", size: 380, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0x1, 0xd4, 0xd6, 0xc7, 0x44, 0xd4, 0xfd, 0x7b, 0x69, 0x1f, 0xe3, 0xe, 0x48, 0x14, 0x99, 0xf0, 0x8e, 0x43, 0xae, 0x54, 0x64, 0xa2, 0x8b, 0x82, 0x1c, 0x2b, 0xb, 0xec, 0xf5, 0xb3, 0xfc}} return a, nil } diff --git a/protocol/communities/community.go b/protocol/communities/community.go index cdac7996f..c120570da 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -191,7 +191,7 @@ func (o *Community) MarshalJSON() ([]byte, error) { } communityItem := struct { ID types.HexBytes `json:"id"` - Admin bool `json:"admin"` + MemberRole protobuf.CommunityMember_Roles `json:"memberRole"` Verified bool `json:"verified"` Joined bool `json:"joined"` Spectated bool `json:"spectated"` @@ -207,8 +207,8 @@ func (o *Community) MarshalJSON() ([]byte, error) { Permissions *protobuf.CommunityPermissions `json:"permissions"` Members map[string]*protobuf.CommunityMember `json:"members"` CanRequestAccess bool `json:"canRequestAccess"` - CanManageUsers bool `json:"canManageUsers"` - CanDeleteMessageForEveryone bool `json:"canDeleteMessageForEveryone"` + CanManageUsers bool `json:"canManageUsers"` //TODO: we can remove this + CanDeleteMessageForEveryone bool `json:"canDeleteMessageForEveryone"` //TODO: we can remove this CanJoin bool `json:"canJoin"` Color string `json:"color"` RequestedToJoinAt uint64 `json:"requestedToJoinAt,omitempty"` @@ -222,7 +222,7 @@ func (o *Community) MarshalJSON() ([]byte, error) { ActiveMembersCount uint64 `json:"activeMembersCount"` }{ ID: o.ID(), - Admin: o.IsAdmin(), + MemberRole: o.MemberRole(o.MemberIdentity()), Verified: o.config.Verified, Chats: make(map[string]CommunityChat), Categories: make(map[string]CommunityCategory), @@ -300,6 +300,18 @@ func (o *Community) MarshalJSON() ([]byte, error) { return json.Marshal(communityItem) } +func (o *Community) Identity() *protobuf.ChatIdentity { + return o.config.CommunityDescription.Identity +} + +func (o *Community) Permissions() *protobuf.CommunityPermissions { + return o.config.CommunityDescription.Permissions +} + +func (o *Community) AdminSettings() *protobuf.CommunityAdminSettings { + return o.config.CommunityDescription.AdminSettings +} + func (o *Community) Name() string { if o != nil && o.config != nil && @@ -354,6 +366,10 @@ func (o *Community) Tags() []CommunityTag { return nil } +func (o *Community) TagsRaw() []string { + return o.config.CommunityDescription.Tags +} + func (o *Community) OutroMessage() string { if o != nil && o.config != nil && @@ -480,6 +496,16 @@ type CommunityChanges struct { ShouldMemberLeave bool `json:"memberRemoved"` } +// `CommunityAdminEventChanges contain additional changes that don't live on +// a `Community` but still have to be propagated to other admin and control nodes +type CommunityAdminEventChanges struct { + *CommunityChanges + // `RejectedRequestsToJoin` is a map of signer keys to requests to join + RejectedRequestsToJoin map[string]*protobuf.CommunityRequestToJoin `json:"rejectedRequestsToJoin"` + // `AcceptedRequestsToJoin` is a map of signer keys to requests to join + AcceptedRequestsToJoin map[string]*protobuf.CommunityRequestToJoin `json:"acceptedRequestsToJoin"` +} + func (c *CommunityChanges) HasNewMember(identity string) bool { if len(c.MembersAdded) == 0 { return false @@ -506,38 +532,15 @@ func (o *Community) CreateChat(chatID string, chat *protobuf.CommunityChat) (*Co o.mutex.Lock() defer o.mutex.Unlock() - if !o.IsAdmin() { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - err := validateCommunityChat(o.config.CommunityDescription, chat) + err := o.createChat(chatID, chat) if err != nil { return nil, err } - if o.config.CommunityDescription.Chats == nil { - o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) - } - if _, ok := o.config.CommunityDescription.Chats[chatID]; ok { - return nil, ErrChatAlreadyExists - } - - for _, c := range o.config.CommunityDescription.Chats { - if chat.Identity.DisplayName == c.Identity.DisplayName { - return nil, ErrInvalidCommunityDescriptionDuplicatedName - } - } - - // Sets the chat position to be the last within its category - chat.Position = 0 - for _, c := range o.config.CommunityDescription.Chats { - if c.CategoryId == chat.CategoryId { - chat.Position++ - } - } - - o.config.CommunityDescription.Chats[chatID] = chat - o.increaseClock() changes := o.emptyCommunityChanges() @@ -549,24 +552,15 @@ func (o *Community) EditChat(chatID string, chat *protobuf.CommunityChat) (*Comm o.mutex.Lock() defer o.mutex.Unlock() - if !o.IsAdmin() { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - err := validateCommunityChat(o.config.CommunityDescription, chat) + err := o.editChat(chatID, chat) if err != nil { return nil, err } - if o.config.CommunityDescription.Chats == nil { - o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) - } - if _, exists := o.config.CommunityDescription.Chats[chatID]; !exists { - return nil, ErrChatNotFound - } - - o.config.CommunityDescription.Chats[chatID] = chat - o.increaseClock() changes := o.emptyCommunityChanges() @@ -577,31 +571,19 @@ func (o *Community) EditChat(chatID string, chat *protobuf.CommunityChat) (*Comm return changes, nil } -func (o *Community) DeleteChat(chatID string) (*protobuf.CommunityDescription, error) { +func (o *Community) DeleteChat(chatID string) (*CommunityChanges, error) { o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - if o.config.CommunityDescription.Chats == nil { - o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) - } - - changes := o.emptyCommunityChanges() - - if chat, exists := o.config.CommunityDescription.Chats[chatID]; exists { - tmpCatID := chat.CategoryId - chat.CategoryId = "" - o.SortCategoryChats(changes, tmpCatID) - } - - delete(o.config.CommunityDescription.Chats, chatID) + changes := o.deleteChat(chatID) o.increaseClock() - return o.config.CommunityDescription, nil + return changes, nil } func (o *Community) InviteUserToOrg(pk *ecdsa.PublicKey) (*protobuf.CommunityInvitation, error) { @@ -612,7 +594,7 @@ func (o *Community) InviteUserToOrg(pk *ecdsa.PublicKey) (*protobuf.CommunityInv return nil, ErrNotAdmin } - err := o.AddMember(pk, []protobuf.CommunityMember_Roles{}) + _, err := o.AddMember(pk, []protobuf.CommunityMember_Roles{}) if err != nil { return nil, err } @@ -716,6 +698,10 @@ func (o *Community) hasMemberPermission(member *protobuf.CommunityMember, permis } func (o *Community) hasPermission(pk *ecdsa.PublicKey, roles map[protobuf.CommunityMember_Roles]bool) bool { + if pk == nil || o.config.ID == nil { + return false + } + if common.IsPubKeyEqual(pk, o.config.ID) { return true } @@ -788,25 +774,29 @@ func (o *Community) removeMemberFromOrg(pk *ecdsa.PublicKey) { for _, chat := range o.config.CommunityDescription.Chats { delete(chat.Members, key) } - - o.increaseClock() } func (o *Community) RemoveOurselvesFromOrg(pk *ecdsa.PublicKey) { o.mutex.Lock() defer o.mutex.Unlock() o.removeMemberFromOrg(pk) + o.increaseClock() } func (o *Community) RemoveUserFromOrg(pk *ecdsa.PublicKey) (*protobuf.CommunityDescription, error) { o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } + if o.IsMemberOwner(pk) { + return nil, ErrNotOwner + } + o.removeMemberFromOrg(pk) + o.increaseClock() return o.config.CommunityDescription, nil } @@ -826,18 +816,11 @@ func (o *Community) UnbanUserFromCommunity(pk *ecdsa.PublicKey) (*protobuf.Commu o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - key := common.PubkeyToHex(pk) - for i, v := range o.config.CommunityDescription.BanList { - if v == key { - o.config.CommunityDescription.BanList = - append(o.config.CommunityDescription.BanList[:i], o.config.CommunityDescription.BanList[i+1:]...) - break - } - } + o.unbanUserFromCommunity(pk) o.increaseClock() @@ -848,29 +831,15 @@ func (o *Community) BanUserFromCommunity(pk *ecdsa.PublicKey) (*protobuf.Communi o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - key := common.PubkeyToHex(pk) - if o.hasMember(pk) { - // Remove from org - delete(o.config.CommunityDescription.Members, key) - // Remove from chats - for _, chat := range o.config.CommunityDescription.Chats { - delete(chat.Members, key) - } + if o.IsMemberOwner(pk) { + return nil, ErrNotOwner } - found := false - for _, u := range o.config.CommunityDescription.BanList { - if u == key { - found = true - } - } - if !found { - o.config.CommunityDescription.BanList = append(o.config.CommunityDescription.BanList, key) - } + o.banUserFromCommunity(pk) o.increaseClock() @@ -994,14 +963,10 @@ func (o *Community) MemberIdentity() *ecdsa.PublicKey { } // UpdateCommunityDescription will update the community to the new community description and return a list of changes -func (o *Community) UpdateCommunityDescription(signer *ecdsa.PublicKey, description *protobuf.CommunityDescription, rawMessage []byte) (*CommunityChanges, error) { +func (o *Community) UpdateCommunityDescription(description *protobuf.CommunityDescription, rawMessage []byte) (*CommunityChanges, error) { o.mutex.Lock() defer o.mutex.Unlock() - if !common.IsPubKeyEqual(o.config.ID, signer) { - return nil, ErrNotAuthorized - } - // This is done in case tags are updated and a client sends unknown tags description.Tags = requests.RemoveUnknownAndDeduplicateTags(description.Tags) @@ -1164,6 +1129,25 @@ func (o *Community) UpdateCommunityDescription(signer *ecdsa.PublicKey, descript response.ChatsModified[chatID].CategoryModified = chat.CategoryId } } + + // Check for removed token permissions + for id := range o.config.CommunityDescription.TokenPermissions { + if _, ok := description.TokenPermissions[id]; !ok { + if response.TokenPermissionsRemoved == nil { + response.TokenPermissionsRemoved = make([]string, 0) + } + response.TokenPermissionsRemoved = append(response.TokenPermissionsRemoved, id) + } + } + + for id, permission := range description.TokenPermissions { + if _, ok := o.config.CommunityDescription.TokenPermissions[id]; !ok { + if response.TokenPermissionsAdded == nil { + response.TokenPermissionsAdded = make(map[string]*protobuf.CommunityTokenPermission) + } + response.TokenPermissionsAdded[id] = permission + } + } } o.config.CommunityDescription = description @@ -1173,8 +1157,8 @@ func (o *Community) UpdateCommunityDescription(signer *ecdsa.PublicKey, descript } func (o *Community) UpdateChatFirstMessageTimestamp(chatID string, timestamp uint32) (*CommunityChanges, error) { - if !o.IsAdmin() { - return nil, ErrNotAdmin + if !o.IsOwner() { + return nil, ErrNotOwner } chat, ok := o.config.CommunityDescription.Chats[chatID] @@ -1197,7 +1181,7 @@ func (o *Community) ValidateRequestToJoin(signer *ecdsa.PublicKey, request *prot defer o.mutex.Unlock() // If we are not admin, fuggetaboutit - if !o.IsAdmin() { + if !o.IsOwnerOrAdmin() { return ErrNotAdmin } @@ -1218,32 +1202,86 @@ func (o *Community) ValidateRequestToJoin(signer *ecdsa.PublicKey, request *prot return nil } +func (o *Community) IsOwner() bool { + return o.config.PrivateKey != nil || o.IsMemberOwner(o.config.MemberIdentity) +} + func (o *Community) IsAdmin() bool { - return o.config.PrivateKey != nil + return o.IsMemberAdmin(o.config.MemberIdentity) +} + +func (o *Community) IsOwnerOrAdmin() bool { + return o.IsOwner() || o.IsAdmin() +} + +func (o *Community) IsMemberOwner(publicKey *ecdsa.PublicKey) bool { + return o.hasPermission(publicKey, ownerRolePermission()) } func (o *Community) IsMemberAdmin(publicKey *ecdsa.PublicKey) bool { return o.hasPermission(publicKey, adminRolePermissions()) } +func (o *Community) IsMemberOwnerOrAdmin(publicKey *ecdsa.PublicKey) bool { + return o.hasPermission(publicKey, ownerOrAdminRolePermissions()) +} + func canManageUsersRolePermissions() map[protobuf.CommunityMember_Roles]bool { - roles := adminRolePermissions() + roles := ownerOrAdminRolePermissions() roles[protobuf.CommunityMember_ROLE_MANAGE_USERS] = true return roles } +func ownerRolePermission() map[protobuf.CommunityMember_Roles]bool { + roles := make(map[protobuf.CommunityMember_Roles]bool) + roles[protobuf.CommunityMember_ROLE_OWNER] = true + return roles +} + func adminRolePermissions() map[protobuf.CommunityMember_Roles]bool { roles := make(map[protobuf.CommunityMember_Roles]bool) - roles[protobuf.CommunityMember_ROLE_ALL] = true + roles[protobuf.CommunityMember_ROLE_ADMIN] = true return roles } +func ownerOrAdminRolePermissions() map[protobuf.CommunityMember_Roles]bool { + roles := make(map[protobuf.CommunityMember_Roles]bool) + roles[protobuf.CommunityMember_ROLE_OWNER] = true + roles[protobuf.CommunityMember_ROLE_ADMIN] = true + return roles +} + +func (o *Community) MemberRole(pubKey *ecdsa.PublicKey) protobuf.CommunityMember_Roles { + if o.IsMemberOwner(pubKey) { + return protobuf.CommunityMember_ROLE_OWNER + } else if o.IsMemberAdmin(pubKey) { + return protobuf.CommunityMember_ROLE_ADMIN + } else if o.CanManageUsers(pubKey) { + return protobuf.CommunityMember_ROLE_MANAGE_USERS + } else if o.CanDeleteMessageForEveryone(pubKey) { + return protobuf.CommunityMember_ROLE_MODERATE_CONTENT + } + + return protobuf.CommunityMember_ROLE_NONE +} + func canDeleteMessageForEveryonePermissions() map[protobuf.CommunityMember_Roles]bool { - roles := adminRolePermissions() + roles := ownerOrAdminRolePermissions() roles[protobuf.CommunityMember_ROLE_MODERATE_CONTENT] = true return roles } +func (o *Community) GetMemberAdmins() []*ecdsa.PublicKey { + admins := make([]*ecdsa.PublicKey, 0) + members := o.GetMemberPubkeys() + for _, member := range members { + if o.IsMemberAdmin(member) { + admins = append(admins, member) + } + } + return admins +} + func (o *Community) validateRequestToJoinWithChatID(request *protobuf.CommunityRequestToJoin) error { chat, ok := o.config.CommunityDescription.Chats[request.ChatId] @@ -1353,8 +1391,8 @@ func (o *Community) toBytes() ([]byte, error) { return nil, ErrNotAdmin } - // We are not admin, use the received serialized version - if o.config.PrivateKey == nil { + //We are not owner or admin, use the received serialized version + if !o.IsOwnerOrAdmin() { return o.config.MarshaledCommunityDescription, nil } @@ -1455,8 +1493,8 @@ func (o *Community) AddTokenPermission(permission *protobuf.CommunityTokenPermis o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { - return nil, ErrNotAdmin + if !o.IsOwnerOrAdmin() || (o.IsAdmin() && permission.Type == protobuf.CommunityTokenPermission_BECOME_ADMIN) { + return nil, ErrNotEnoughPermissions } if o.config.CommunityDescription.TokenPermissions == nil { @@ -1484,8 +1522,8 @@ func (o *Community) UpdateTokenPermission(permissionID string, tokenPermission * o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { - return nil, ErrNotAdmin + if !o.IsOwnerOrAdmin() || (o.IsAdmin() && tokenPermission.Type == protobuf.CommunityTokenPermission_BECOME_ADMIN) { + return nil, ErrNotEnoughPermissions } if o.config.CommunityDescription.TokenPermissions == nil { @@ -1511,12 +1549,14 @@ func (o *Community) DeleteTokenPermission(permissionID string) (*CommunityChange o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { - return nil, ErrNotAdmin + permission, exists := o.config.CommunityDescription.TokenPermissions[permissionID] + + if !exists { + return nil, ErrTokenPermissionNotFound } - if _, exists := o.config.CommunityDescription.TokenPermissions[permissionID]; !exists { - return nil, ErrTokenPermissionNotFound + if !o.IsOwnerOrAdmin() || (o.IsAdmin() && permission.Type == protobuf.CommunityTokenPermission_BECOME_ADMIN) { + return nil, ErrNotEnoughPermissions } delete(o.config.CommunityDescription.TokenPermissions, permissionID) @@ -1665,25 +1705,29 @@ func (o *Community) BuildGrant(key *ecdsa.PublicKey, chatID string) ([]byte, err } func (o *Community) buildGrant(key *ecdsa.PublicKey, chatID string) ([]byte, error) { - grant := &protobuf.Grant{ - CommunityId: o.ID(), - MemberId: crypto.CompressPubkey(key), - ChatId: chatID, - Clock: o.config.CommunityDescription.Clock, - } - marshaledGrant, err := proto.Marshal(grant) - if err != nil { - return nil, err - } + bytes := make([]byte, 0) + if o.config.PrivateKey != nil { + grant := &protobuf.Grant{ + CommunityId: o.ID(), + MemberId: crypto.CompressPubkey(key), + ChatId: chatID, + Clock: o.config.CommunityDescription.Clock, + } + marshaledGrant, err := proto.Marshal(grant) + if err != nil { + return nil, err + } - signatureMaterial := crypto.Keccak256(marshaledGrant) + signatureMaterial := crypto.Keccak256(marshaledGrant) - signature, err := crypto.Sign(signatureMaterial, o.config.PrivateKey) - if err != nil { - return nil, err + signature, err := crypto.Sign(signatureMaterial, o.config.PrivateKey) + if err != nil { + return nil, err + } + + bytes = append(signature, marshaledGrant...) } - - return append(signature, marshaledGrant...), nil + return bytes, nil } func (o *Community) increaseClock() { @@ -1714,7 +1758,7 @@ func (o *Community) CanManageUsers(pk *ecdsa.PublicKey) bool { o.mutex.Lock() defer o.mutex.Unlock() - if o.IsAdmin() { + if o.IsOwner() { return true } @@ -1731,13 +1775,14 @@ func (o *Community) CanDeleteMessageForEveryone(pk *ecdsa.PublicKey) bool { o.mutex.Lock() defer o.mutex.Unlock() - if o.IsAdmin() { + if o.IsOwner() { return true } if !o.hasMember(pk) { return false } + roles := canDeleteMessageForEveryonePermissions() return o.hasPermission(pk, roles) } @@ -1756,7 +1801,7 @@ func (o *Community) canJoin() bool { return false } - if o.IsAdmin() { + if o.IsOwner() { return true } @@ -1800,12 +1845,13 @@ func (o *Community) RequestsToJoin() []*RequestToJoin { return o.config.RequestsToJoin } -func (o *Community) AddMember(publicKey *ecdsa.PublicKey, roles []protobuf.CommunityMember_Roles) error { - if o.config.PrivateKey == nil { - return ErrNotAdmin +func (o *Community) AddMember(publicKey *ecdsa.PublicKey, roles []protobuf.CommunityMember_Roles) (*CommunityChanges, error) { + if !o.IsOwnerOrAdmin() { + return nil, ErrNotAdmin } memberKey := common.PubkeyToHex(publicKey) + changes := o.emptyCommunityChanges() if o.config.CommunityDescription.Members == nil { o.config.CommunityDescription.Members = make(map[string]*protobuf.CommunityMember) @@ -1813,9 +1859,11 @@ func (o *Community) AddMember(publicKey *ecdsa.PublicKey, roles []protobuf.Commu if _, ok := o.config.CommunityDescription.Members[memberKey]; !ok { o.config.CommunityDescription.Members[memberKey] = &protobuf.CommunityMember{Roles: roles} + changes.MembersAdded[memberKey] = o.config.CommunityDescription.Members[memberKey] } + o.increaseClock() - return nil + return changes, nil } func (o *Community) ChatIDs() (chatIDs []string) { @@ -1833,7 +1881,7 @@ func (o *Community) AddMemberRevealedAccounts(memberID string, accounts []*proto o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } @@ -1849,6 +1897,27 @@ func (o *Community) AddMemberRevealedAccounts(memberID string, accounts []*proto return changes, nil } +func (o *Community) createDeepCopy() Community { + return Community{ + config: &Config{ + PrivateKey: o.config.PrivateKey, + CommunityDescription: proto.Clone(o.config.CommunityDescription).(*protobuf.CommunityDescription), + MarshaledCommunityDescription: o.config.MarshaledCommunityDescription, + ID: o.config.ID, + Joined: o.config.Joined, + Requested: o.config.Requested, + Verified: o.config.Verified, + Spectated: o.config.Spectated, + Muted: o.config.Muted, + Logger: o.config.Logger, + RequestedToJoinAt: o.config.RequestedToJoinAt, + RequestsToJoin: o.config.RequestsToJoin, + MemberIdentity: o.config.MemberIdentity, + SyncedAt: o.config.SyncedAt, + }, + } +} + func (o *Community) SetActiveMembersCount(activeMembersCount uint64) (updated bool, err error) { o.mutex.Lock() defer o.mutex.Unlock() @@ -1903,3 +1972,160 @@ func (d sortSlice) Swap(i, j int) { func (d sortSlice) Less(i, j int) bool { return d[i].pos < d[j].pos } + +func (o *Community) unbanUserFromCommunity(pk *ecdsa.PublicKey) { + key := common.PubkeyToHex(pk) + for i, v := range o.config.CommunityDescription.BanList { + if v == key { + o.config.CommunityDescription.BanList = + append(o.config.CommunityDescription.BanList[:i], o.config.CommunityDescription.BanList[i+1:]...) + break + } + } +} + +func (o *Community) banUserFromCommunity(pk *ecdsa.PublicKey) { + key := common.PubkeyToHex(pk) + if o.hasMember(pk) { + // Remove from org + delete(o.config.CommunityDescription.Members, key) + + // Remove from chats + for _, chat := range o.config.CommunityDescription.Chats { + delete(chat.Members, key) + } + } + + for _, u := range o.config.CommunityDescription.BanList { + if u == key { + return + } + } + + o.config.CommunityDescription.BanList = append(o.config.CommunityDescription.BanList, key) +} + +func (o *Community) editChat(chatID string, chat *protobuf.CommunityChat) error { + err := validateCommunityChat(o.config.CommunityDescription, chat) + if err != nil { + return err + } + + if o.config.CommunityDescription.Chats == nil { + o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) + } + if _, exists := o.config.CommunityDescription.Chats[chatID]; !exists { + return ErrChatNotFound + } + + o.config.CommunityDescription.Chats[chatID] = chat + + return nil +} + +func (o *Community) createChat(chatID string, chat *protobuf.CommunityChat) error { + err := validateCommunityChat(o.config.CommunityDescription, chat) + if err != nil { + return err + } + + if o.config.CommunityDescription.Chats == nil { + o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) + } + if _, ok := o.config.CommunityDescription.Chats[chatID]; ok { + return ErrChatAlreadyExists + } + + for _, c := range o.config.CommunityDescription.Chats { + if chat.Identity.DisplayName == c.Identity.DisplayName { + return ErrInvalidCommunityDescriptionDuplicatedName + } + } + + // Sets the chat position to be the last within its category + chat.Position = 0 + for _, c := range o.config.CommunityDescription.Chats { + if c.CategoryId == chat.CategoryId { + chat.Position++ + } + } + + o.config.CommunityDescription.Chats[chatID] = chat + + return nil +} + +func (o *Community) deleteChat(chatID string) *CommunityChanges { + if o.config.CommunityDescription.Chats == nil { + o.config.CommunityDescription.Chats = make(map[string]*protobuf.CommunityChat) + } + + changes := o.emptyCommunityChanges() + + if chat, exists := o.config.CommunityDescription.Chats[chatID]; exists { + tmpCatID := chat.CategoryId + chat.CategoryId = "" + o.SortCategoryChats(changes, tmpCatID) + changes.ChatsRemoved[chatID] = chat + } + + delete(o.config.CommunityDescription.Chats, chatID) + return changes +} + +func (o *Community) deleteBecomeMemberTokenPermissions(newPermissions map[string]*protobuf.CommunityTokenPermission) { + if len(newPermissions) == 0 { + o.config.CommunityDescription.TokenPermissions = make(map[string]*protobuf.CommunityTokenPermission) + return + } + + prevPermissions := o.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + + if len(newPermissions) < len(prevPermissions) { + for _, permission := range newPermissions { + if permissionExists(permission.Id, prevPermissions) { + delete(o.config.CommunityDescription.TokenPermissions, permission.Id) + } + } + } +} + +func (o *Community) addBecomeMemberTokenPermissions(newPermissions map[string]*protobuf.CommunityTokenPermission) { + if o.config.CommunityDescription.TokenPermissions == nil { + o.config.CommunityDescription.TokenPermissions = make(map[string]*protobuf.CommunityTokenPermission) + } + prevPermissions := o.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + for _, permission := range newPermissions { + if !permissionExists(permission.Id, prevPermissions) { + o.config.CommunityDescription.TokenPermissions[permission.Id] = permission + } + } +} + +func (o *Community) updateTokenPermissions(newPermissions map[string]*protobuf.CommunityTokenPermission) { + if o.config.CommunityDescription.TokenPermissions == nil { + o.config.CommunityDescription.TokenPermissions = make(map[string]*protobuf.CommunityTokenPermission) + } + for _, newPermission := range newPermissions { + o.config.CommunityDescription.TokenPermissions[newPermission.Id] = newPermission + } +} + +func (o *Community) addCommunityMember(pk *ecdsa.PublicKey, member *protobuf.CommunityMember) { + + if o.config.CommunityDescription.Members == nil { + o.config.CommunityDescription.Members = make(map[string]*protobuf.CommunityMember) + } + + memberKey := common.PubkeyToHex(pk) + o.config.CommunityDescription.Members[memberKey] = member +} + +func permissionExists(id string, prevPermissions []*protobuf.CommunityTokenPermission) bool { + for _, prevPermission := range prevPermissions { + if prevPermission.Id == id { + return true + } + } + return false +} diff --git a/protocol/communities/community_admin_event.go b/protocol/communities/community_admin_event.go new file mode 100644 index 000000000..9f52bf70a --- /dev/null +++ b/protocol/communities/community_admin_event.go @@ -0,0 +1,346 @@ +package communities + +import ( + "errors" + + "github.com/status-im/status-go/protocol/common" + "github.com/status-im/status-go/protocol/protobuf" +) + +func (o *Community) ToCreateChannelAdminEvent(channelID string, channel *protobuf.CommunityChat) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_CREATE, + ChannelData: &protobuf.ChannelData{ + ChannelId: channelID, + Channel: channel, + }, + } +} + +func (o *Community) ToEditChannelAdminEvent(channelID string, channel *protobuf.CommunityChat) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_EDIT, + ChannelData: &protobuf.ChannelData{ + ChannelId: channelID, + Channel: channel, + }, + } +} + +func (o *Community) ToDeleteChannelAdminEvent(channelID string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_DELETE, + ChannelData: &protobuf.ChannelData{ + ChannelId: channelID, + }, + } +} + +func (o *Community) ToReorderChannelAdminEvent(categoryID string, channelID string, position int) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_REORDER, + ChannelData: &protobuf.ChannelData{ + CategoryId: categoryID, + ChannelId: channelID, + Position: int32(position), + }, + } +} + +func (o *Community) ToCreateCategoryAdminEvent(categoryID string, categoryName string, channelsIds []string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_CREATE, + CategoryData: &protobuf.CategoryData{ + Name: categoryName, + CategoryId: categoryID, + ChannelsIds: channelsIds, + }, + } +} + +func (o *Community) ToEditCategoryAdminEvent(categoryID string, categoryName string, channelsIds []string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_EDIT, + CategoryData: &protobuf.CategoryData{ + Name: categoryName, + CategoryId: categoryID, + ChannelsIds: channelsIds, + }, + } +} + +func (o *Community) ToDeleteCategoryAdminEvent(categoryID string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_DELETE, + CategoryData: &protobuf.CategoryData{ + CategoryId: categoryID, + }, + } +} + +func (o *Community) ToReorderCategoryAdminEvent(categoryID string, position int) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_REORDER, + CategoryData: &protobuf.CategoryData{ + CategoryId: categoryID, + Position: int32(position), + }, + } +} + +func (o *Community) ToBanCommunityMemberAdminEvent(pubkey string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_BAN, + MemberToAction: pubkey, + } +} + +func (o *Community) ToUnbanCommunityMemberAdminEvent(pubkey string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_UNBAN, + MemberToAction: pubkey, + } +} + +func (o *Community) ToKickCommunityMemberAdminEvent(pubkey string) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_KICK, + MemberToAction: pubkey, + } +} + +func (o *Community) ToCommunityEditAdminEvent() *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_EDIT, + CommunityConfig: &protobuf.CommunityConfig{ + Identity: o.Identity(), + Permissions: o.Permissions(), + AdminSettings: o.AdminSettings(), + IntroMessage: o.IntroMessage(), + OutroMessage: o.OutroMessage(), + Tags: o.TagsRaw(), + }, + } +} + +func (o *Community) ToCommunityBecomeMemberTokenPermissionChangeAdminEvent() *protobuf.CommunityAdminEvent { + tokenPermissions := make(map[string]*protobuf.CommunityTokenPermission) + for _, tp := range o.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) { + tokenPermissions[tp.Id] = tp + } + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE, + TokenPermissions: tokenPermissions, + } +} + +func (o *Community) ToCommunityBecomeMemberTokenPermissionDeleteAdminEvent() *protobuf.CommunityAdminEvent { + tokenPermissions := make(map[string]*protobuf.CommunityTokenPermission) + for _, tp := range o.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) { + tokenPermissions[tp.Id] = tp + } + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE, + TokenPermissions: tokenPermissions, + } +} + +func (o *Community) ToCommunityRequestToJoinAcceptAdminEvent(changes *CommunityAdminEventChanges) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_ACCEPT, + MembersAdded: changes.MembersAdded, + AcceptedRequestsToJoin: changes.AcceptedRequestsToJoin, + } +} + +func (o *Community) ToCommunityRequestToJoinRejectAdminEvent(changes *CommunityAdminEventChanges) *protobuf.CommunityAdminEvent { + return &protobuf.CommunityAdminEvent{ + Clock: o.Clock(), + CommunityId: o.ID(), + Type: protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_REJECT, + RejectedRequestsToJoin: changes.RejectedRequestsToJoin, + } +} + +func (o *Community) PatchCommunityDescriptionByAdminEvent(adminEvent *protobuf.CommunityAdminEvent) (*protobuf.CommunityDescription, error) { + o.mutex.Lock() + defer o.mutex.Unlock() + + if adminEvent.Clock <= o.config.CommunityDescription.Clock { + return nil, errors.New("clock for admin event is outdated") + } + + if adminEvent.Type == protobuf.CommunityAdminEvent_UNKNOWN { + return nil, errors.New("unknown admin event") + } + + // create a deep copy of current community so we can patch CommunityDescription + copy := o.createDeepCopy() + + copy.config.CommunityDescription.Clock = adminEvent.Clock + + switch adminEvent.Type { + case protobuf.CommunityAdminEvent_COMMUNITY_EDIT: + if adminEvent.CommunityConfig == nil || adminEvent.CommunityConfig.Identity == nil || + adminEvent.CommunityConfig.Permissions == nil || adminEvent.CommunityConfig.AdminSettings == nil { + return nil, errors.New("invalid config change admin event") + } + copy.config.CommunityDescription.Identity = adminEvent.CommunityConfig.Identity + copy.config.CommunityDescription.Permissions = adminEvent.CommunityConfig.Permissions + copy.config.CommunityDescription.AdminSettings = adminEvent.CommunityConfig.AdminSettings + copy.config.CommunityDescription.IntroMessage = adminEvent.CommunityConfig.IntroMessage + copy.config.CommunityDescription.OutroMessage = adminEvent.CommunityConfig.OutroMessage + copy.config.CommunityDescription.Tags = adminEvent.CommunityConfig.Tags + + case protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE: + prevPermissions := copy.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + newPermissions := adminEvent.TokenPermissions + + if len(newPermissions) < len(prevPermissions) { + // we only handle additions and update in this event type + break + } + + if len(newPermissions) > len(prevPermissions) { + copy.addBecomeMemberTokenPermissions(newPermissions) + break + } + + // update existing permissions + copy.updateTokenPermissions(newPermissions) + + case protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE: + copy.deleteBecomeMemberTokenPermissions(adminEvent.TokenPermissions) + + case protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_CREATE: + _, err := copy.createCategory(adminEvent.CategoryData.CategoryId, adminEvent.CategoryData.Name, adminEvent.CategoryData.ChannelsIds) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_DELETE: + _, err := copy.deleteCategory(adminEvent.CategoryData.CategoryId) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_EDIT: + _, err := copy.editCategory(adminEvent.CategoryData.CategoryId, adminEvent.CategoryData.Name, adminEvent.CategoryData.ChannelsIds) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_CREATE: + err := copy.createChat(adminEvent.ChannelData.ChannelId, adminEvent.ChannelData.Channel) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_DELETE: + copy.deleteChat(adminEvent.ChannelData.ChannelId) + + case protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_EDIT: + err := copy.editChat(adminEvent.ChannelData.ChannelId, adminEvent.ChannelData.Channel) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CHANNEL_REORDER: + _, err := copy.reorderChat(adminEvent.ChannelData.CategoryId, adminEvent.ChannelData.ChannelId, int(adminEvent.ChannelData.Position)) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_CATEGORY_REORDER: + _, err := copy.reorderCategories(adminEvent.CategoryData.CategoryId, int(adminEvent.CategoryData.Position)) + if err != nil { + return nil, err + } + + case protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_ACCEPT: + for pkString, addedMember := range adminEvent.MembersAdded { + pk, err := common.HexToPubkey(pkString) + if err != nil { + return nil, err + } + if !copy.HasMember(pk) { + copy.addCommunityMember(pk, addedMember) + } + } + + case protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_REJECT: + // Do not remove this case! + // + // if we've received a rejected request to join, there's nothing that needs + // to be done on the `Community`. + // + // However, we need to leave this case here, otherwise it'll end up in + // the default case, which will error out + break + + case protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_KICK: + pk, err := common.HexToPubkey(adminEvent.MemberToAction) + if err != nil { + return nil, err + } + + if copy.IsMemberOwner(pk) { + return nil, errors.New("attempt to kick an owner of the community from the admin side") + } + + copy.removeMemberFromOrg(pk) + + case protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_BAN: + pk, err := common.HexToPubkey(adminEvent.MemberToAction) + if err != nil { + return nil, err + } + + if copy.IsMemberOwner(pk) { + return nil, errors.New("attempt to ban an owner of the community from the admin side") + } + copy.banUserFromCommunity(pk) + + case protobuf.CommunityAdminEvent_COMMUNITY_MEMBER_UNBAN: + pk, err := common.HexToPubkey(adminEvent.MemberToAction) + if err != nil { + return nil, err + } + copy.unbanUserFromCommunity(pk) + + default: + return nil, errors.New("unknown admin community event") + } + + return copy.config.CommunityDescription, nil +} diff --git a/protocol/communities/community_categories.go b/protocol/communities/community_categories.go index 18182e18e..ab13b4a82 100644 --- a/protocol/communities/community_categories.go +++ b/protocol/communities/community_categories.go @@ -26,42 +26,14 @@ func (o *Community) CreateCategory(categoryID string, categoryName string, chatI o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - if o.config.CommunityDescription.Categories == nil { - o.config.CommunityDescription.Categories = make(map[string]*protobuf.CommunityCategory) + changes, err := o.createCategory(categoryID, categoryName, chatIDs) + if err != nil { + return nil, err } - if _, ok := o.config.CommunityDescription.Categories[categoryID]; ok { - return nil, ErrCategoryAlreadyExists - } - - for _, cid := range chatIDs { - c, exists := o.config.CommunityDescription.Chats[cid] - if !exists { - return nil, ErrChatNotFound - } - - if exists && c.CategoryId != categoryID && c.CategoryId != "" { - return nil, ErrChatAlreadyAssigned - } - } - - changes := o.emptyCommunityChanges() - - o.config.CommunityDescription.Categories[categoryID] = &protobuf.CommunityCategory{ - CategoryId: categoryID, - Name: categoryName, - Position: int32(len(o.config.CommunityDescription.Categories)), - } - - for i, cid := range chatIDs { - o.config.CommunityDescription.Chats[cid].CategoryId = categoryID - o.config.CommunityDescription.Chats[cid].Position = int32(i) - } - - o.SortCategoryChats(changes, "") o.increaseClock() @@ -82,67 +54,14 @@ func (o *Community) EditCategory(categoryID string, categoryName string, chatIDs o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - if o.config.CommunityDescription.Categories == nil { - o.config.CommunityDescription.Categories = make(map[string]*protobuf.CommunityCategory) + changes, err := o.editCategory(categoryID, categoryName, chatIDs) + if err != nil { + return nil, err } - if _, ok := o.config.CommunityDescription.Categories[categoryID]; !ok { - return nil, ErrCategoryNotFound - } - - for _, cid := range chatIDs { - c, exists := o.config.CommunityDescription.Chats[cid] - if !exists { - return nil, ErrChatNotFound - } - - if exists && c.CategoryId != categoryID && c.CategoryId != "" { - return nil, ErrChatAlreadyAssigned - } - } - - changes := o.emptyCommunityChanges() - - emptyCatLen := o.getCategoryChatCount("") - - // remove any chat that might have been assigned before and now it's not part of the category - var chatsToRemove []string - for k, chat := range o.config.CommunityDescription.Chats { - if chat.CategoryId == categoryID { - found := false - for _, c := range chatIDs { - if k == c { - found = true - } - } - if !found { - chat.CategoryId = "" - chatsToRemove = append(chatsToRemove, k) - } - } - } - - o.config.CommunityDescription.Categories[categoryID].Name = categoryName - - for i, cid := range chatIDs { - o.config.CommunityDescription.Chats[cid].CategoryId = categoryID - o.config.CommunityDescription.Chats[cid].Position = int32(i) - } - - for i, cid := range chatsToRemove { - o.config.CommunityDescription.Chats[cid].Position = int32(emptyCatLen + i) - changes.ChatsModified[cid] = &CommunityChatChanges{ - MembersAdded: make(map[string]*protobuf.CommunityMember), - MembersRemoved: make(map[string]*protobuf.CommunityMember), - CategoryModified: "", - PositionModified: int(o.config.CommunityDescription.Chats[cid].Position), - } - } - - o.SortCategoryChats(changes, "") o.increaseClock() @@ -163,72 +82,15 @@ func (o *Community) ReorderCategories(categoryID string, newPosition int) (*Comm o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - if _, exists := o.config.CommunityDescription.Categories[categoryID]; !exists { - return nil, ErrCategoryNotFound + changes, err := o.reorderCategories(categoryID, newPosition) + if err != nil { + return nil, err } - if newPosition > 0 && newPosition >= len(o.config.CommunityDescription.Categories) { - newPosition = len(o.config.CommunityDescription.Categories) - 1 - } else if newPosition < 0 { - newPosition = 0 - } - - category := o.config.CommunityDescription.Categories[categoryID] - if category.Position == int32(newPosition) { - return nil, ErrNoChangeInPosition - } - - decrease := false - if category.Position > int32(newPosition) { - decrease = true - } - - // Sorting the categories because maps are not guaranteed to keep order - s := make(sortSlice, 0, len(o.config.CommunityDescription.Categories)) - for k, v := range o.config.CommunityDescription.Categories { - s = append(s, sorterHelperIdx{ - pos: v.Position, - catID: k, - }) - } - sort.Sort(s) - var communityCategories []*protobuf.CommunityCategory - for _, currCat := range s { - communityCategories = append(communityCategories, o.config.CommunityDescription.Categories[currCat.catID]) - } - - var sortedCategoryIDs []string - for _, v := range communityCategories { - if v != category && ((decrease && v.Position < int32(newPosition)) || (!decrease && v.Position <= int32(newPosition))) { - sortedCategoryIDs = append(sortedCategoryIDs, v.CategoryId) - } - } - - sortedCategoryIDs = append(sortedCategoryIDs, categoryID) - - for _, v := range communityCategories { - if v.CategoryId == categoryID || (decrease && v.Position < int32(newPosition)) || (!decrease && v.Position <= int32(newPosition)) { - continue - } - sortedCategoryIDs = append(sortedCategoryIDs, v.CategoryId) - } - - s = make(sortSlice, 0, len(o.config.CommunityDescription.Categories)) - for i, k := range sortedCategoryIDs { - s = append(s, sorterHelperIdx{ - pos: int32(i), - catID: k, - }) - } - - changes := o.emptyCommunityChanges() - - o.setModifiedCategories(changes, s) - o.increaseClock() return changes, nil @@ -248,30 +110,15 @@ func (o *Community) ReorderChat(categoryID string, chatID string, newPosition in o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } - if categoryID != "" { - if _, exists := o.config.CommunityDescription.Categories[categoryID]; !exists { - return nil, ErrCategoryNotFound - } + changes, err := o.reorderChat(categoryID, chatID, newPosition) + if err != nil { + return nil, err } - var chat *protobuf.CommunityChat - var exists bool - if chat, exists = o.config.CommunityDescription.Chats[chatID]; !exists { - return nil, ErrChatNotFound - } - - oldCategoryID := chat.CategoryId - chat.CategoryId = categoryID - - changes := o.emptyCommunityChanges() - - o.SortCategoryChats(changes, oldCategoryID) - o.insertAndSort(changes, oldCategoryID, categoryID, chatID, chat, newPosition) - o.increaseClock() return changes, nil @@ -406,10 +253,120 @@ func (o *Community) DeleteCategory(categoryID string) (*CommunityChanges, error) o.mutex.Lock() defer o.mutex.Unlock() - if o.config.PrivateKey == nil { + if !o.IsOwnerOrAdmin() { return nil, ErrNotAdmin } + changes, err := o.deleteCategory(categoryID) + if err != nil { + return nil, err + } + + o.increaseClock() + + return changes, nil +} + +func (o *Community) createCategory(categoryID string, categoryName string, chatIDs []string) (*CommunityChanges, error) { + if o.config.CommunityDescription.Categories == nil { + o.config.CommunityDescription.Categories = make(map[string]*protobuf.CommunityCategory) + } + if _, ok := o.config.CommunityDescription.Categories[categoryID]; ok { + return nil, ErrCategoryAlreadyExists + } + + for _, cid := range chatIDs { + c, exists := o.config.CommunityDescription.Chats[cid] + if !exists { + return nil, ErrChatNotFound + } + + if exists && c.CategoryId != categoryID && c.CategoryId != "" { + return nil, ErrChatAlreadyAssigned + } + } + + changes := o.emptyCommunityChanges() + + o.config.CommunityDescription.Categories[categoryID] = &protobuf.CommunityCategory{ + CategoryId: categoryID, + Name: categoryName, + Position: int32(len(o.config.CommunityDescription.Categories)), + } + + for i, cid := range chatIDs { + o.config.CommunityDescription.Chats[cid].CategoryId = categoryID + o.config.CommunityDescription.Chats[cid].Position = int32(i) + } + + o.SortCategoryChats(changes, "") + + return changes, nil +} + +func (o *Community) editCategory(categoryID string, categoryName string, chatIDs []string) (*CommunityChanges, error) { + if o.config.CommunityDescription.Categories == nil { + o.config.CommunityDescription.Categories = make(map[string]*protobuf.CommunityCategory) + } + if _, ok := o.config.CommunityDescription.Categories[categoryID]; !ok { + return nil, ErrCategoryNotFound + } + + for _, cid := range chatIDs { + c, exists := o.config.CommunityDescription.Chats[cid] + if !exists { + return nil, ErrChatNotFound + } + + if exists && c.CategoryId != categoryID && c.CategoryId != "" { + return nil, ErrChatAlreadyAssigned + } + } + + changes := o.emptyCommunityChanges() + + emptyCatLen := o.getCategoryChatCount("") + + // remove any chat that might have been assigned before and now it's not part of the category + var chatsToRemove []string + for k, chat := range o.config.CommunityDescription.Chats { + if chat.CategoryId == categoryID { + found := false + for _, c := range chatIDs { + if k == c { + found = true + } + } + if !found { + chat.CategoryId = "" + chatsToRemove = append(chatsToRemove, k) + } + } + } + + o.config.CommunityDescription.Categories[categoryID].Name = categoryName + + for i, cid := range chatIDs { + o.config.CommunityDescription.Chats[cid].CategoryId = categoryID + o.config.CommunityDescription.Chats[cid].Position = int32(i) + } + + for i, cid := range chatsToRemove { + o.config.CommunityDescription.Chats[cid].Position = int32(emptyCatLen + i) + changes.ChatsModified[cid] = &CommunityChatChanges{ + MembersAdded: make(map[string]*protobuf.CommunityMember), + MembersRemoved: make(map[string]*protobuf.CommunityMember), + CategoryModified: "", + PositionModified: int(o.config.CommunityDescription.Chats[cid].Position), + } + } + + o.SortCategoryChats(changes, "") + + return changes, nil +} + +func (o *Community) deleteCategory(categoryID string) (*CommunityChanges, error) { if _, exists := o.config.CommunityDescription.Categories[categoryID]; !exists { return nil, ErrCategoryNotFound } @@ -443,7 +400,95 @@ func (o *Community) DeleteCategory(categoryID string) (*CommunityChanges, error) o.setModifiedCategories(changes, s) - o.increaseClock() + return changes, nil +} + +func (o *Community) reorderCategories(categoryID string, newPosition int) (*CommunityChanges, error) { + if _, exists := o.config.CommunityDescription.Categories[categoryID]; !exists { + return nil, ErrCategoryNotFound + } + + if newPosition > 0 && newPosition >= len(o.config.CommunityDescription.Categories) { + newPosition = len(o.config.CommunityDescription.Categories) - 1 + } else if newPosition < 0 { + newPosition = 0 + } + + category := o.config.CommunityDescription.Categories[categoryID] + if category.Position == int32(newPosition) { + return nil, ErrNoChangeInPosition + } + + decrease := false + if category.Position > int32(newPosition) { + decrease = true + } + + // Sorting the categories because maps are not guaranteed to keep order + s := make(sortSlice, 0, len(o.config.CommunityDescription.Categories)) + for k, v := range o.config.CommunityDescription.Categories { + s = append(s, sorterHelperIdx{ + pos: v.Position, + catID: k, + }) + } + sort.Sort(s) + var communityCategories []*protobuf.CommunityCategory + for _, currCat := range s { + communityCategories = append(communityCategories, o.config.CommunityDescription.Categories[currCat.catID]) + } + + var sortedCategoryIDs []string + for _, v := range communityCategories { + if v != category && ((decrease && v.Position < int32(newPosition)) || (!decrease && v.Position <= int32(newPosition))) { + sortedCategoryIDs = append(sortedCategoryIDs, v.CategoryId) + } + } + + sortedCategoryIDs = append(sortedCategoryIDs, categoryID) + + for _, v := range communityCategories { + if v.CategoryId == categoryID || (decrease && v.Position < int32(newPosition)) || (!decrease && v.Position <= int32(newPosition)) { + continue + } + sortedCategoryIDs = append(sortedCategoryIDs, v.CategoryId) + } + + s = make(sortSlice, 0, len(o.config.CommunityDescription.Categories)) + for i, k := range sortedCategoryIDs { + s = append(s, sorterHelperIdx{ + pos: int32(i), + catID: k, + }) + } + + changes := o.emptyCommunityChanges() + + o.setModifiedCategories(changes, s) + + return changes, nil +} + +func (o *Community) reorderChat(categoryID string, chatID string, newPosition int) (*CommunityChanges, error) { + if categoryID != "" { + if _, exists := o.config.CommunityDescription.Categories[categoryID]; !exists { + return nil, ErrCategoryNotFound + } + } + + var chat *protobuf.CommunityChat + var exists bool + if chat, exists = o.config.CommunityDescription.Chats[chatID]; !exists { + return nil, ErrChatNotFound + } + + oldCategoryID := chat.CategoryId + chat.CategoryId = categoryID + + changes := o.emptyCommunityChanges() + + o.SortCategoryChats(changes, oldCategoryID) + o.insertAndSort(changes, oldCategoryID, categoryID, chatID, chat, newPosition) return changes, nil } diff --git a/protocol/communities/community_categories_test.go b/protocol/communities/community_categories_test.go index eebc2c81b..dd32c77a4 100644 --- a/protocol/communities/community_categories_test.go +++ b/protocol/communities/community_categories_test.go @@ -10,11 +10,13 @@ func (s *CommunitySuite) TestCreateCategory() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil _, err := org.CreateCategory(newCategoryID, newCategoryName, []string{}) s.Require().Equal(ErrNotAdmin, err) org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey changes, err := org.CreateCategory(newCategoryID, newCategoryName, []string{}) @@ -85,11 +87,13 @@ func (s *CommunitySuite) TestEditCategory() { _, err := org.CreateCategory(newCategoryID, newCategoryName, []string{testChatID1}) s.Require().NoError(err) org.config.PrivateKey = nil + org.config.ID = nil _, err = org.EditCategory(newCategoryID, editedCategoryName, []string{testChatID1}) s.Require().Equal(ErrNotAdmin, err) org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey _, err = org.EditCategory("some-random-category", editedCategoryName, []string{testChatID1}) s.Require().Equal(ErrCategoryNotFound, err) @@ -212,10 +216,12 @@ func (s *CommunitySuite) TestDeleteCategory() { s.Require().Equal(int32(1), description.Chats[testChatID1].Position) org.config.PrivateKey = nil + org.config.ID = nil _, err = org.DeleteCategory(testCategoryID1) s.Require().Equal(ErrNotAdmin, err) org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey _, err = org.DeleteCategory("some-category-id") s.Require().Equal(ErrCategoryNotFound, err) @@ -264,14 +270,16 @@ func (s *CommunitySuite) TestDeleteChatOrder() { _, err = org.CreateCategory(newCategoryID, newCategoryName, []string{testChatID1, testChatID2, testChatID3}) s.Require().NoError(err) - description, err := org.DeleteChat(testChatID2) + changes, err := org.DeleteChat(testChatID2) s.Require().NoError(err) - s.Require().Equal(int32(0), description.Chats[testChatID1].Position) - s.Require().Equal(int32(1), description.Chats[testChatID3].Position) + s.Require().Equal(int32(0), org.Chats()[testChatID1].Position) + s.Require().Equal(int32(1), org.Chats()[testChatID3].Position) + s.Require().Len(changes.ChatsRemoved, 1) - description, err = org.DeleteChat(testChatID1) + changes, err = org.DeleteChat(testChatID1) s.Require().NoError(err) - s.Require().Equal(int32(0), description.Chats[testChatID3].Position) + s.Require().Equal(int32(0), org.Chats()[testChatID3].Position) + s.Require().Len(changes.ChatsRemoved, 1) _, err = org.DeleteChat(testChatID3) s.Require().NoError(err) diff --git a/protocol/communities/community_test.go b/protocol/communities/community_test.go index 4bb1f6e26..c6f4486e9 100644 --- a/protocol/communities/community_test.go +++ b/protocol/communities/community_test.go @@ -67,12 +67,14 @@ func (s *CommunitySuite) TestInviteUserToOrg() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil // Not an admin _, err = org.InviteUserToOrg(&s.member2.PublicKey) s.Require().Equal(ErrNotAdmin, err) // Add admin to community org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey response, err := org.InviteUserToOrg(&newMember.PublicKey) s.Require().Nil(err) @@ -106,6 +108,7 @@ func (s *CommunitySuite) TestCreateChat() { newChatID := "new-chat-id" org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil identity := &protobuf.ChatIdentity{ DisplayName: "new-chat-display-name", @@ -123,6 +126,7 @@ func (s *CommunitySuite) TestCreateChat() { s.Require().Equal(ErrNotAdmin, err) org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey changes, err := org.CreateChat(newChatID, &protobuf.CommunityChat{ Identity: identity, @@ -174,6 +178,7 @@ func (s *CommunitySuite) TestEditChat() { s.Require().NoError(err) org.config.PrivateKey = nil + org.config.ID = nil editedIdentity := &protobuf.ChatIdentity{ DisplayName: "edited-new-chat-display-name", Description: "edited-new-chat-description", @@ -192,6 +197,7 @@ func (s *CommunitySuite) TestEditChat() { description := org.config.CommunityDescription org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey editChanges, err := org.EditChat(newChatID, &protobuf.CommunityChat{ Identity: editedIdentity, Permissions: editedPermissions, @@ -213,18 +219,21 @@ func (s *CommunitySuite) TestEditChat() { func (s *CommunitySuite) TestDeleteChat() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil _, err := org.DeleteChat(testChatID1) s.Require().Equal(ErrNotAdmin, err) org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey - description, err := org.DeleteChat(testChatID1) + changes, err := org.DeleteChat(testChatID1) s.Require().NoError(err) - s.Require().NotNil(description) + s.Require().NotNil(changes) - s.Require().Nil(description.Chats[testChatID1]) - s.Require().Equal(uint64(2), description.Clock) + s.Require().Nil(org.Chats()[testChatID1]) + s.Require().Len(changes.ChatsRemoved, 1) + s.Require().Equal(uint64(2), org.Clock()) } func (s *CommunitySuite) TestInviteUserToChat() { @@ -233,12 +242,14 @@ func (s *CommunitySuite) TestInviteUserToChat() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil // Not an admin _, err = org.InviteUserToChat(&s.member2.PublicKey, testChatID1) s.Require().Equal(ErrNotAdmin, err) // Add admin to community org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey response, err := org.InviteUserToChat(&newMember.PublicKey, testChatID1) s.Require().Nil(err) @@ -278,12 +289,14 @@ func (s *CommunitySuite) TestInviteUserToChat() { func (s *CommunitySuite) TestRemoveUserFromChat() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil // Not an admin _, err := org.RemoveUserFromOrg(&s.member1.PublicKey) s.Require().Equal(ErrNotAdmin, err) // Add admin to community org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey actualCommunity, err := org.RemoveUserFromChat(&s.member1.PublicKey, testChatID1) s.Require().Nil(err) @@ -304,12 +317,14 @@ func (s *CommunitySuite) TestRemoveUserFromChat() { func (s *CommunitySuite) TestRemoveUserFormOrg() { org := s.buildCommunity(&s.identity.PublicKey) org.config.PrivateKey = nil + org.config.ID = nil // Not an admin _, err := org.RemoveUserFromOrg(&s.member1.PublicKey) s.Require().Equal(ErrNotAdmin, err) // Add admin to community org.config.PrivateKey = s.identity + org.config.ID = &s.identity.PublicKey actualCommunity, err := org.RemoveUserFromOrg(&s.member1.PublicKey) s.Require().Nil(err) @@ -723,7 +738,7 @@ func (s *CommunitySuite) TestHandleCommunityDescription() { org := s.buildCommunity(signer) org.Join() expectedChanges := tc.changes(org) - actualChanges, err := org.UpdateCommunityDescription(tc.signer, tc.description(org), []byte{0x01}) + actualChanges, err := org.UpdateCommunityDescription(tc.description(org), []byte{0x01}) s.Require().Equal(tc.err, err) s.Require().Equal(expectedChanges, actualChanges) }) @@ -950,7 +965,6 @@ func (s *CommunitySuite) memberInChatNotInOrgCommunityDescription() *protobuf.Co } func (s *CommunitySuite) buildCommunity(owner *ecdsa.PublicKey) *Community { - config := s.config() config.ID = owner config.CommunityDescription = s.buildCommunityDescription() diff --git a/protocol/communities/errors.go b/protocol/communities/errors.go index efd00ca9c..9d96936e6 100644 --- a/protocol/communities/errors.go +++ b/protocol/communities/errors.go @@ -24,6 +24,7 @@ var ErrInvalidCommunityDescriptionDuplicatedName = errors.New("invalid community var ErrInvalidCommunityDescriptionUnknownChatCategory = errors.New("invalid community category in chat") var ErrInvalidCommunityTags = errors.New("invalid community tags") var ErrNotAdmin = errors.New("no admin privileges for this community") +var ErrNotOwner = errors.New("no owner privileges for this community") var ErrInvalidGrant = errors.New("invalid grant") var ErrNotAuthorized = errors.New("not authorized") var ErrAlreadyMember = errors.New("already a member") @@ -35,3 +36,4 @@ var ErrTokenPermissionNotFound = errors.New("token permission not found") var ErrNoPermissionToJoin = errors.New("member has no permission to join") var ErrMemberWalletAlreadyExists = errors.New("member wallet already exists") var ErrMemberWalletNotFound = errors.New("member wallet not found") +var ErrNotEnoughPermissions = errors.New("not enough permissions for this community") diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 868b3aa08..24da81d45 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -39,6 +39,7 @@ import ( "github.com/status-im/status-go/protocol/protobuf" "github.com/status-im/status-go/protocol/requests" "github.com/status-im/status-go/protocol/transport" + "github.com/status-im/status-go/protocol/v1" walletcommon "github.com/status-im/status-go/services/wallet/common" "github.com/status-im/status-go/services/wallet/thirdparty/opensea" "github.com/status-im/status-go/services/wallet/token" @@ -293,6 +294,7 @@ type Subscription struct { DownloadingHistoryArchivesStartedSignal *signal.DownloadingHistoryArchivesStartedSignal DownloadingHistoryArchivesFinishedSignal *signal.DownloadingHistoryArchivesFinishedSignal ImportingHistoryArchiveMessagesSignal *signal.ImportingHistoryArchiveMessagesSignal + CommunityAdminEvent *protobuf.CommunityAdminEvent } type CommunityResponse struct { @@ -530,7 +532,7 @@ func (m *Manager) CreateCommunity(request *requests.CreateCommunity, publish boo } description.Members = make(map[string]*protobuf.CommunityMember) - description.Members[common.PubkeyToHex(&m.identity.PublicKey)] = &protobuf.CommunityMember{Roles: []protobuf.CommunityMember_Roles{protobuf.CommunityMember_ROLE_ALL}} + description.Members[common.PubkeyToHex(&m.identity.PublicKey)] = &protobuf.CommunityMember{Roles: []protobuf.CommunityMember_Roles{protobuf.CommunityMember_ROLE_OWNER}} err = ValidateCommunityDescription(description) if err != nil { @@ -594,14 +596,23 @@ func (m *Manager) CreateCommunityTokenPermission(request *requests.CreateCommuni return nil, nil, err } - m.publish(&Subscription{Community: community}) - - // check existing member permission once, then check periodically - err = m.checkMemberPermissions(community.ID()) - if err != nil { - return nil, nil, err + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else { + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityBecomeMemberTokenPermissionChangeAdminEvent()}) + } + + if community.IsOwner() { + // check existing member permission once, then check periodically + go func() { + err := m.checkMemberPermissions(community, false) + if err != nil { + m.logger.Debug("failed to check member permissions", zap.Error(err)) + } + + m.CheckMemberPermissionsPeriodically(community.ID()) + }() } - go m.CheckMemberPermissionsPeriodically(community.ID()) return community, changes, nil } @@ -627,59 +638,109 @@ func (m *Manager) EditCommunityTokenPermission(request *requests.EditCommunityTo return nil, nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() && tokenPermission.Type == protobuf.CommunityTokenPermission_BECOME_MEMBER { + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityBecomeMemberTokenPermissionChangeAdminEvent()}) + } // check if members still fulfill the token criteria of all // BECOME_MEMBER permissions and kick them if necessary // // We do this in a separate routine to not block // this function - if tokenPermission.Type == protobuf.CommunityTokenPermission_BECOME_MEMBER { - go func() { - err := m.checkMemberPermissions(community.ID()) - if err != nil { - m.logger.Debug("failed to check member permissions", zap.Error(err)) - } - }() - } + go func() { + err := m.checkMemberPermissions(community, false) + if err != nil { + m.logger.Debug("failed to check member permissions", zap.Error(err)) + } + }() return community, changes, nil } -func (m *Manager) checkMemberPermissions(communityID types.HexBytes) error { - community, err := m.GetByID(communityID) - if err != nil { - return err - } +func (m *Manager) checkMemberPermissions(community *Community, removeAdmins bool) error { becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + becomeAdminPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_ADMIN) - if len(becomeMemberPermissions) > 0 { - for memberKey, member := range community.Members() { - if memberKey == common.PubkeyToHex(&m.identity.PublicKey) { - continue - } + adminPermissions := len(becomeAdminPermissions) > 0 + memberPermissions := len(becomeMemberPermissions) > 0 - accountsAndChainIDs := revealedAccountsToAccountsAndChainIDsCombination(member.RevealedAccounts) + if !adminPermissions && !memberPermissions && !removeAdmins { + m.publish(&Subscription{Community: community}) + return nil + } - permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) + for memberKey, member := range community.Members() { + memberPubKey, err := common.HexToPubkey(memberKey) + if err != nil { + return err + } + + if memberKey == common.PubkeyToHex(&m.identity.PublicKey) || community.IsMemberOwner(memberPubKey) { + continue + } + + isAdmin := community.IsMemberAdmin(memberPubKey) + memberHasWallet := len(member.RevealedAccounts) > 0 + + // Check if user was not treated as an admin without wallet in open community + // or user treated as a member without wallet in closed community + if (!memberHasWallet && isAdmin) || (memberPermissions && !memberHasWallet) { + _, err = community.RemoveUserFromOrg(memberPubKey) if err != nil { return err } + continue + } - hasPermission := permissionResponse.Satisfied + accountsAndChainIDs := revealedAccountsToAccountsAndChainIDsCombination(member.RevealedAccounts) - if !hasPermission { - pk, err := common.HexToPubkey(memberKey) - if err != nil { - return err - } - _, err = community.RemoveUserFromOrg(pk) + // Check if user is still an admin or can become an admin and do update of member role + removeAdminRole := false + if adminPermissions { + permissionResponse, err := m.checkPermissionToJoin(becomeAdminPermissions, accountsAndChainIDs, true) + if err != nil { + return err + } else if permissionResponse.Satisfied && !isAdmin { + _, err = community.AddRoleToMember(memberPubKey, protobuf.CommunityMember_ROLE_ADMIN) if err != nil { return err } + isAdmin = true + } else if !permissionResponse.Satisfied && isAdmin { + removeAdminRole = true + isAdmin = false + } + } + + // Remove admin role if user does not pass admin permissions or we do not have admin permissions but have an admin role + if removeAdminRole || isAdmin && removeAdmins { + _, err = community.RemoveRoleFromMember(memberPubKey, protobuf.CommunityMember_ROLE_ADMIN) + if err != nil { + return err + } + isAdmin = false + } + + // Skip further validation if user has admin permissions or we do not have member permissions + if isAdmin || !memberPermissions { + continue + } + + permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) + if err != nil { + return err + } + + if !permissionResponse.Satisfied { + _, err = community.RemoveUserFromOrg(memberPubKey) + if err != nil { + return err } } } + m.publish(&Subscription{Community: community}) return nil } @@ -699,7 +760,13 @@ func (m *Manager) CheckMemberPermissionsPeriodically(communityID types.HexBytes) for { select { case <-ticker.C: - err := m.checkMemberPermissions(communityID) + community, err := m.GetByID(communityID) + if err != nil { + m.logger.Debug("can't validate member permissions, community was not found", zap.Error(err)) + m.periodicMemberPermissionsTasks.Delete(communityID.String()) + } + + err = m.checkMemberPermissions(community, true) if err != nil { m.logger.Debug("failed to check member permissions", zap.Error(err)) } @@ -729,15 +796,26 @@ func (m *Manager) DeleteCommunityTokenPermission(request *requests.DeleteCommuni return nil, nil, err } - // Check if there's stil BECOME_MEMBER permissions, - // if not we can stop checking token criteria on-chain - // for members - becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) - if cancel, exists := m.periodicMemberPermissionsTasks.Load(community.IDString()); exists && len(becomeMemberPermissions) == 0 { - close(cancel.(chan struct{})) // Need to cast to the chan + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityBecomeMemberTokenPermissionDeleteAdminEvent()}) } - m.publish(&Subscription{Community: community}) + becomeAdminPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_ADMIN) + + // Make sure that we remove admins roles if we remove admin permissions + err = m.checkMemberPermissions(community, len(becomeAdminPermissions) == 0) + if err != nil { + return nil, nil, err + } + + // Check if there's stil BECOME_ADMIN and BECOME_MEMBER permissions, + // if not we can stop checking token criteria on-chain + if cancel, exists := m.periodicMemberPermissionsTasks.Load(community.IDString()); exists && + len(community.TokenPermissions()) == 0 { + close(cancel.(chan struct{})) // Need to cast to the chan + } return community, changes, nil } @@ -760,8 +838,9 @@ func (m *Manager) EditCommunity(request *requests.EditCommunity) (*Community, er if community == nil { return nil, ErrOrgNotFound } - if !community.IsAdmin() { - return nil, errors.New("not an admin") + + if !community.IsOwnerOrAdmin() { + return nil, ErrNotEnoughPermissions } newDescription, err := request.ToCommunityDescription() @@ -804,7 +883,11 @@ func (m *Manager) EditCommunity(request *requests.EditCommunity) (*Community, er return nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityEditAdminEvent()}) + } return community, nil } @@ -815,8 +898,8 @@ func (m *Manager) ExportCommunity(id types.HexBytes) (*ecdsa.PrivateKey, error) return nil, err } - if !community.IsAdmin() { - return nil, errors.New("not an admin") + if !community.IsOwner() { + return nil, ErrNotOwner } return community.config.PrivateKey, nil @@ -885,7 +968,11 @@ func (m *Manager) CreateChat(communityID types.HexBytes, chat *protobuf.Communit // Advertise changes if publish { - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToCreateChannelAdminEvent(chatID, chat)}) + } } return community, changes, nil @@ -916,12 +1003,16 @@ func (m *Manager) EditChat(communityID types.HexBytes, chatID string, chat *prot } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToEditChannelAdminEvent(chatID, chat)}) + } return community, changes, nil } -func (m *Manager) DeleteChat(communityID types.HexBytes, chatID string) (*Community, *protobuf.CommunityDescription, error) { +func (m *Manager) DeleteChat(communityID types.HexBytes, chatID string) (*Community, *CommunityChanges, error) { community, err := m.GetByID(communityID) if err != nil { return nil, nil, err @@ -934,7 +1025,7 @@ func (m *Manager) DeleteChat(communityID types.HexBytes, chatID string) (*Commun if strings.HasPrefix(chatID, communityID.String()) { chatID = strings.TrimPrefix(chatID, communityID.String()) } - description, err := community.DeleteChat(chatID) + changes, err := community.DeleteChat(chatID) if err != nil { return nil, nil, err } @@ -945,9 +1036,13 @@ func (m *Manager) DeleteChat(communityID types.HexBytes, chatID string) (*Commun } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToDeleteChannelAdminEvent(chatID)}) + } - return community, description, nil + return community, changes, nil } func (m *Manager) CreateCategory(request *requests.CreateCommunityCategory, publish bool) (*Community, *CommunityChanges, error) { @@ -982,8 +1077,10 @@ func (m *Manager) CreateCategory(request *requests.CreateCommunityCategory, publ } // Advertise changes - if publish { + if community.IsOwner() { m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToCreateCategoryAdminEvent(categoryID, request.CategoryName, request.ChatIDs)}) } return community, changes, nil @@ -1016,7 +1113,11 @@ func (m *Manager) EditCategory(request *requests.EditCommunityCategory) (*Commun } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToEditCategoryAdminEvent(request.CategoryID, request.CategoryName, request.ChatIDs)}) + } return community, changes, nil } @@ -1071,7 +1172,11 @@ func (m *Manager) ReorderCategories(request *requests.ReorderCommunityCategories } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToReorderCategoryAdminEvent(request.CategoryID, request.Position)}) + } return community, changes, nil } @@ -1101,7 +1206,11 @@ func (m *Manager) ReorderChat(request *requests.ReorderCommunityChat) (*Communit } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToReorderChannelAdminEvent(request.CategoryID, request.ChatID, request.Position)}) + } return community, changes, nil } @@ -1126,7 +1235,11 @@ func (m *Manager) DeleteCategory(request *requests.DeleteCommunityCategory) (*Co } // Advertise changes - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToDeleteCategoryAdminEvent(request.CategoryID)}) + } return community, changes, nil } @@ -1137,6 +1250,7 @@ func (m *Manager) HandleCommunityDescriptionMessage(signer *ecdsa.PublicKey, des } id := crypto.CompressPubkey(signer) + community, err := m.persistence.GetByID(&m.identity.PublicKey, id) if err != nil { return nil, err @@ -1157,7 +1271,15 @@ func (m *Manager) HandleCommunityDescriptionMessage(signer *ecdsa.PublicKey, des } } - changes, err := community.UpdateCommunityDescription(signer, description, payload) + if !common.IsPubKeyEqual(community.PublicKey(), signer) { + return nil, ErrNotAuthorized + } + + return m.handleCommunityDescriptionMessageCommon(community, description, payload) +} + +func (m *Manager) handleCommunityDescriptionMessageCommon(community *Community, description *protobuf.CommunityDescription, payload []byte) (*CommunityResponse, error) { + changes, err := community.UpdateCommunityDescription(description, payload) if err != nil { return nil, err } @@ -1224,6 +1346,108 @@ func (m *Manager) HandleCommunityDescriptionMessage(signer *ecdsa.PublicKey, des }, nil } +func (m *Manager) HandleCommunityAdminEvent(signer *ecdsa.PublicKey, adminEvent *protobuf.CommunityAdminEvent, payload []byte) (*CommunityResponse, error) { + if signer == nil { + return nil, errors.New("signer can't be nil") + } + + community, err := m.persistence.GetByID(&m.identity.PublicKey, adminEvent.CommunityId) + if err != nil { + return nil, err + } + + if !community.IsMemberAdmin(signer) { + return nil, errors.New("user is not an admin") + } + + patchedCommDescr, err := community.PatchCommunityDescriptionByAdminEvent(adminEvent) + if err != nil { + return nil, err + } + + marshaledCommDescr, err := proto.Marshal(patchedCommDescr) + if err != nil { + return nil, err + } + + // Some admin changes do not live on a `Community` and need to be handled by + // `Manager` here + err = m.handleAdditionalAdminChanges(community, adminEvent) + if err != nil { + return nil, err + } + + rawMessage, err := protocol.WrapMessageV1(marshaledCommDescr, protobuf.ApplicationMetadataMessage_COMMUNITY_DESCRIPTION, community.PrivateKey()) + if err != nil { + return nil, err + } + + return m.handleCommunityDescriptionMessageCommon(community, patchedCommDescr, rawMessage) +} + +func (m *Manager) handleAdditionalAdminChanges(community *Community, adminEvent *protobuf.CommunityAdminEvent) error { + + saveOrUpdateRequestToJoin := func(signer string, request *protobuf.CommunityRequestToJoin, state RequestToJoinState) error { + requestToJoin := &RequestToJoin{ + PublicKey: signer, + Clock: request.Clock, + ENSName: request.EnsName, + CommunityID: request.CommunityId, + State: state, + RevealedAccounts: request.RevealedAccounts, + } + + requestToJoin.CalculateID() + + existingRequestToJoin, err := m.persistence.GetRequestToJoin(requestToJoin.ID) + if err != nil && err != sql.ErrNoRows { + return err + } + + if existingRequestToJoin != nil { + // node already knows about this request to join, so let's compare clocks + // and update it if necessary + if existingRequestToJoin.Clock <= requestToJoin.Clock { + pk, err := common.HexToPubkey(existingRequestToJoin.PublicKey) + if err != nil { + return err + } + err = m.persistence.SetRequestToJoinState(common.PubkeyToHex(pk), community.ID(), state) + if err != nil { + return err + } + } + } else { + err := m.persistence.SaveRequestToJoin(requestToJoin) + if err != nil { + return err + } + } + return nil + } + + switch adminEvent.Type { + case protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_ACCEPT: + for signer, request := range adminEvent.AcceptedRequestsToJoin { + err := saveOrUpdateRequestToJoin(signer, request, RequestToJoinStateAccepted) + if err != nil { + return err + } + } + + case protobuf.CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_REJECT: + for signer, request := range adminEvent.RejectedRequestsToJoin { + err := saveOrUpdateRequestToJoin(signer, request, RequestToJoinStateDeclined) + if err != nil { + return err + } + } + + default: + } + return nil +} + // TODO: This is not fully implemented, we want to save the grant passed at // this stage and make sure it's used when publishing. func (m *Manager) HandleCommunityInvitation(signer *ecdsa.PublicKey, invitation *protobuf.CommunityInvitation, payload []byte) (*CommunityResponse, error) { @@ -1315,15 +1539,18 @@ func (m *Manager) CheckPermissionToJoin(id []byte, addresses []gethcommon.Addres return nil, err } + becomeAdminPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_ADMIN) becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + permissionsToJoin := append(becomeAdminPermissions, becomeMemberPermissions...) + allChainIDs, err := m.tokenManager.GetAllChainIDs() if err != nil { return nil, err } accountsAndChainIDs := combineAddressesAndChainIDs(addresses, allChainIDs) - hasPermission, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, false) + hasPermission, err := m.checkPermissionToJoin(permissionsToJoin, accountsAndChainIDs, false) if err != nil { return nil, err } @@ -1342,25 +1569,37 @@ func (m *Manager) AcceptRequestToJoin(request *requests.AcceptRequestToJoinCommu return nil, err } + becomeAdminPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_ADMIN) becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) revealedAccounts := make([]*protobuf.RevealedAccount, 0) - if len(becomeMemberPermissions) > 0 { - revealedAccounts, err = m.persistence.GetRequestToJoinRevealedAddresses(dbRequest.ID) + memberRole := protobuf.CommunityMember_ROLE_NONE + + if len(becomeMemberPermissions) > 0 || len(becomeAdminPermissions) > 0 { + revealedAccounts, err := m.persistence.GetRequestToJoinRevealedAddresses(dbRequest.ID) if err != nil { return nil, err } accountsAndChainIDs := revealedAccountsToAccountsAndChainIDsCombination(revealedAccounts) - permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) - if err != nil { - return nil, err - } - hasPermission := permissionResponse.Satisfied + // admin token permissions required to became an admin must not cancel request to join + // if requirements were not met + hasPermission := m.accountsHasAdminPermission(becomeAdminPermissions, accountsAndChainIDs) - if !hasPermission { - return community, ErrNoPermissionToJoin + if hasPermission { + memberRole = protobuf.CommunityMember_ROLE_ADMIN + } else if len(becomeMemberPermissions) > 0 { + permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) + if err != nil { + return nil, err + } + + hasPermission := permissionResponse.Satisfied + + if !hasPermission { + return community, ErrNoPermissionToJoin + } } } @@ -1369,7 +1608,12 @@ func (m *Manager) AcceptRequestToJoin(request *requests.AcceptRequestToJoinCommu return nil, err } - err = community.AddMember(pk, []protobuf.CommunityMember_Roles{}) + role := []protobuf.CommunityMember_Roles{} + if memberRole != protobuf.CommunityMember_ROLE_NONE { + role = []protobuf.CommunityMember_Roles{memberRole} + } + + changes, err := community.AddMember(pk, role) if err != nil { return nil, err } @@ -1388,7 +1632,19 @@ func (m *Manager) AcceptRequestToJoin(request *requests.AcceptRequestToJoinCommu return nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + acceptedRequestsToJoin := make(map[string]*protobuf.CommunityRequestToJoin) + acceptedRequestsToJoin[dbRequest.PublicKey] = dbRequest.ToCommunityRequestToJoinProtobuf() + + adminChanges := &CommunityAdminEventChanges{ + CommunityChanges: changes, + AcceptedRequestsToJoin: acceptedRequestsToJoin, + } + + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityRequestToJoinAcceptAdminEvent(adminChanges)}) + } return community, nil } @@ -1403,7 +1659,36 @@ func (m *Manager) DeclineRequestToJoin(request *requests.DeclineRequestToJoinCom return err } - return m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, RequestToJoinStateDeclined) + community, err := m.GetByID(dbRequest.CommunityID) + if err != nil { + return err + } + + err = m.persistence.SetRequestToJoinState(dbRequest.PublicKey, dbRequest.CommunityID, RequestToJoinStateDeclined) + if err != nil { + return err + } + + // typically, community's clock is increased implicitly when making changes + // to it, however in this scenario there are no changes in the community, yet + // we need to increase the clock to ensure the admin event is processed by other + // nodes. + community.increaseClock() + + rejectedRequestsToJoin := make(map[string]*protobuf.CommunityRequestToJoin) + rejectedRequestsToJoin[dbRequest.PublicKey] = dbRequest.ToCommunityRequestToJoinProtobuf() + + adminChanges := &CommunityAdminEventChanges{ + CommunityChanges: community.emptyCommunityChanges(), + RejectedRequestsToJoin: rejectedRequestsToJoin, + } + + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToCommunityRequestToJoinRejectAdminEvent(adminChanges)}) + } + return nil } func (m *Manager) isUserRejectedFromCommunity(signer *ecdsa.PublicKey, community *Community, requestClock uint64) (bool, error) { @@ -1498,47 +1783,36 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request return nil, err } + becomeAdminPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_ADMIN) becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) // If user is already a member, then accept request automatically // It may happen when member removes itself from community and then tries to rejoin // More specifically, CommunityRequestToLeave may be delivered later than CommunityRequestToJoin, or not delivered at all acceptAutomatically := community.AcceptRequestToJoinAutomatically() || community.HasMember(signer) - if len(becomeMemberPermissions) == 0 && acceptAutomatically { - err = m.markRequestToJoin(signer, community) - if err != nil { - return nil, err - } - requestToJoin.State = RequestToJoinStateAccepted - return requestToJoin, nil - } + hasPermission := false - if len(becomeMemberPermissions) > 0 { - // we have token permissions but requester hasn't revealed - // any addresses - if len(request.RevealedAccounts) == 0 { - err = m.markRequestToJoinAsCanceled(signer, community) + // if we have admin or member permission and user revealed the address - process verification + // if user does not reveal the address and we have member permission only - we decline this request + // if user does not reveal the address and we have admin permission only - user allowed to join as a member + // in non private community + if (len(becomeMemberPermissions) > 0 || len(becomeAdminPermissions) > 0) && len(request.RevealedAccounts) > 0 { + accountsAndChainIDs := revealedAccountsToAccountsAndChainIDsCombination(request.RevealedAccounts) + + // admin token permissions required to become an admin must not cancel request to join + // if requirements were not met + hasPermission = m.accountsHasAdminPermission(becomeAdminPermissions, accountsAndChainIDs) + + // if user does not have admin permissions, check on member permissions + if !hasPermission && len(becomeMemberPermissions) > 0 { + permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) if err != nil { return nil, err } - requestToJoin.State = RequestToJoinStateDeclined - return requestToJoin, nil - } - // verify if revealed addresses indeed belong to requester - for _, revealedAccount := range request.RevealedAccounts { - recoverParams := account.RecoverParams{ - Message: types.EncodeHex(crypto.Keccak256(crypto.CompressPubkey(signer), community.ID(), requestToJoin.ID)), - Signature: types.EncodeHex(revealedAccount.Signature), - } + hasPermission = permissionResponse.Satisfied - recovered, err := m.accountsManager.Recover(recoverParams) - if err != nil { - return nil, err - } - if recovered.Hex() != revealedAccount.Address { - // if ownership of only one wallet address cannot be verified, - // we mark the request as cancelled and stop + if !hasPermission { err = m.markRequestToJoinAsCanceled(signer, community) if err != nil { return nil, err @@ -1548,39 +1822,30 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request } } - accountsAndChainIDs := revealedAccountsToAccountsAndChainIDsCombination(request.RevealedAccounts) - - // provided wallet addresses seem to be legit, so let's check - // if the necessary token permission funds exist - permissionResponse, err := m.checkPermissionToJoin(becomeMemberPermissions, accountsAndChainIDs, true) - if err != nil { - return nil, err - } - hasPermission := permissionResponse.Satisfied - - if !hasPermission { - err = m.markRequestToJoinAsCanceled(signer, community) - if err != nil { - return nil, err - } - requestToJoin.State = RequestToJoinStateDeclined - return requestToJoin, nil - } - // Save revealed addresses + signatures so they can later be added // to the community member list when the request is accepted err = m.persistence.SaveRequestToJoinRevealedAddresses(requestToJoin) if err != nil { return nil, err } - - if hasPermission && acceptAutomatically { - err = m.markRequestToJoin(signer, community) - if err != nil { - return nil, err - } - requestToJoin.State = RequestToJoinStateAccepted + } else if len(becomeMemberPermissions) > 0 && len(request.RevealedAccounts) == 0 { + // we have member token permissions but requester hasn't revealed + // any addresses + err = m.markRequestToJoinAsCanceled(signer, community) + if err != nil { + return nil, err } + requestToJoin.State = RequestToJoinStateDeclined + return requestToJoin, nil + } + + if (len(becomeMemberPermissions) == 0 || hasPermission) && acceptAutomatically { + err = m.markRequestToJoin(signer, community) + if err != nil { + return nil, err + } + requestToJoin.State = RequestToJoinStateAccepted + return requestToJoin, nil } return requestToJoin, nil @@ -1987,7 +2252,11 @@ func (m *Manager) HandleCommunityRequestToJoinResponse(signer *ecdsa.PublicKey, return nil, err } - _, err = community.UpdateCommunityDescription(signer, request.Community, appMetadataMsg) + if !common.IsPubKeyEqual(community.PublicKey(), signer) && !community.IsMemberAdmin(signer) { + return nil, ErrNotAuthorized + } + + _, err = community.UpdateCommunityDescription(request.Community, appMetadataMsg) if err != nil { return nil, err } @@ -2186,7 +2455,7 @@ func (m *Manager) AddMemberOwnerToCommunity(communityID types.HexBytes, pk *ecds return nil, ErrOrgNotFound } - err = community.AddMember(pk, []protobuf.CommunityMember_Roles{protobuf.CommunityMember_ROLE_ALL}) + _, err = community.AddMember(pk, []protobuf.CommunityMember_Roles{protobuf.CommunityMember_ROLE_OWNER}) if err != nil { return nil, err } @@ -2219,7 +2488,11 @@ func (m *Manager) RemoveUserFromCommunity(id types.HexBytes, pk *ecdsa.PublicKey return nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToKickCommunityMemberAdminEvent(common.PubkeyToHex(pk))}) + } return community, nil } @@ -2249,7 +2522,11 @@ func (m *Manager) UnbanUserFromCommunity(request *requests.UnbanUserFromCommunit return nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToUnbanCommunityMemberAdminEvent(request.User.String())}) + } return community, nil } @@ -2348,7 +2625,11 @@ func (m *Manager) BanUserFromCommunity(request *requests.BanUserFromCommunity) ( return nil, err } - m.publish(&Subscription{Community: community}) + if community.IsOwner() { + m.publish(&Subscription{Community: community}) + } else if community.IsAdmin() { + m.publish(&Subscription{CommunityAdminEvent: community.ToBanCommunityMemberAdminEvent(request.User.String())}) + } return community, nil } @@ -2429,6 +2710,11 @@ func (m *Manager) CanceledRequestsToJoinForCommunity(id types.HexBytes) ([]*Requ return m.persistence.CanceledRequestsToJoinForCommunity(id) } +func (m *Manager) AcceptedRequestsToJoinForCommunity(id types.HexBytes) ([]*RequestToJoin, error) { + m.logger.Info("fetching canceled invitations", zap.String("community-id", id.String())) + return m.persistence.AcceptedRequestsToJoinForCommunity(id) +} + func (m *Manager) CanPost(pk *ecdsa.PublicKey, communityID string, chatID string, grant []byte) (bool, error) { community, err := m.GetByIDString(communityID) if err != nil { @@ -3623,3 +3909,15 @@ func revealedAccountsToAccountsAndChainIDsCombination(revealedAccounts []*protob } return accountsAndChainIDs } + +func (m *Manager) accountsHasAdminPermission(becomeAdminPermissions []*protobuf.CommunityTokenPermission, accounts []*AccountChainIDsCombination) bool { + if len(becomeAdminPermissions) > 0 { + permissionResponse, err := m.checkPermissionToJoin(becomeAdminPermissions, accounts, true) + if err != nil { + m.logger.Warn("check admin permission failed: %v", zap.Error(err)) + return false + } + return permissionResponse.Satisfied + } + return false +} diff --git a/protocol/communities/persistence.go b/protocol/communities/persistence.go index 7c1f779ca..c9d32c298 100644 --- a/protocol/communities/persistence.go +++ b/protocol/communities/persistence.go @@ -527,6 +527,10 @@ func (p *Persistence) CanceledRequestsToJoinForCommunity(id []byte) ([]*RequestT return p.RequestsToJoinForCommunityWithState(id, RequestToJoinStateCanceled) } +func (p *Persistence) AcceptedRequestsToJoinForCommunity(id []byte) ([]*RequestToJoin, error) { + return p.RequestsToJoinForCommunityWithState(id, RequestToJoinStateAccepted) +} + func (p *Persistence) SetRequestToJoinState(pk string, communityID []byte, state RequestToJoinState) error { _, err := p.db.Exec(`UPDATE communities_requests_to_join SET state = ? WHERE community_id = ? AND public_key = ?`, state, communityID, pk) return err diff --git a/protocol/communities/request_to_join.go b/protocol/communities/request_to_join.go index 9d0ba1dff..b8830a637 100644 --- a/protocol/communities/request_to_join.go +++ b/protocol/communities/request_to_join.go @@ -35,6 +35,15 @@ func (r *RequestToJoin) CalculateID() { r.ID = CalculateRequestID(r.PublicKey, r.CommunityID) } +func (r *RequestToJoin) ToCommunityRequestToJoinProtobuf() *protobuf.CommunityRequestToJoin { + return &protobuf.CommunityRequestToJoin{ + Clock: r.Clock, + EnsName: r.ENSName, + CommunityId: r.CommunityID, + RevealedAccounts: r.RevealedAccounts, + } +} + func (r *RequestToJoin) ToSyncProtobuf() *protobuf.SyncCommunityRequestsToJoin { return &protobuf.SyncCommunityRequestsToJoin{ Id: r.ID, diff --git a/protocol/communities_messenger_admin_test.go b/protocol/communities_messenger_admin_test.go new file mode 100644 index 000000000..f92eb51f1 --- /dev/null +++ b/protocol/communities_messenger_admin_test.go @@ -0,0 +1,1534 @@ +package protocol + +import ( + "context" + "crypto/ecdsa" + "encoding/json" + "errors" + "io/ioutil" + "testing" + + "github.com/google/uuid" + "github.com/stretchr/testify/suite" + "go.uber.org/zap" + + "github.com/status-im/status-go/account/generator" + gethbridge "github.com/status-im/status-go/eth-node/bridge/geth" + "github.com/status-im/status-go/eth-node/crypto" + "github.com/status-im/status-go/eth-node/types" + "github.com/status-im/status-go/multiaccounts" + "github.com/status-im/status-go/multiaccounts/settings" + "github.com/status-im/status-go/params" + "github.com/status-im/status-go/protocol/common" + "github.com/status-im/status-go/protocol/communities" + "github.com/status-im/status-go/protocol/protobuf" + "github.com/status-im/status-go/protocol/requests" + "github.com/status-im/status-go/protocol/sqlite" + "github.com/status-im/status-go/protocol/tt" + "github.com/status-im/status-go/waku" +) + +func TestAdminMessengerCommunitiesSuite(t *testing.T) { + suite.Run(t, new(AdminMessengerCommunitiesSuite)) +} + +type AdminMessengerCommunitiesSuite struct { + suite.Suite + owner *Messenger + admin *Messenger + alice *Messenger + // If one wants to send messages between different instances of Messenger, + // a single Waku service should be shared. + shh types.Waku + logger *zap.Logger +} + +func (s *AdminMessengerCommunitiesSuite) SetupTest() { + s.logger = tt.MustCreateTestLogger() + + config := waku.DefaultConfig + config.MinimumAcceptedPoW = 0 + shh := waku.New(&config, s.logger) + s.shh = gethbridge.NewGethWakuWrapper(shh) + s.Require().NoError(shh.Start()) + + s.owner = s.newMessenger() + s.admin = s.newMessenger() + s.alice = s.newMessenger() + _, err := s.owner.Start() + s.Require().NoError(err) + _, err = s.admin.Start() + s.Require().NoError(err) + _, err = s.alice.Start() + s.Require().NoError(err) +} + +func (s *AdminMessengerCommunitiesSuite) TearDownTest() { + s.Require().NoError(s.owner.Shutdown()) + s.Require().NoError(s.admin.Shutdown()) + s.Require().NoError(s.alice.Shutdown()) + _ = s.logger.Sync() +} + +func (s *AdminMessengerCommunitiesSuite) newMessengerWithOptions(shh types.Waku, privateKey *ecdsa.PrivateKey, options []Option) *Messenger { + m, err := NewMessenger( + "Test", + privateKey, + &testNode{shh: shh}, + uuid.New().String(), + nil, + nil, + options..., + ) + s.Require().NoError(err) + + err = m.Init() + s.Require().NoError(err) + + config := params.NodeConfig{ + NetworkID: 10, + DataDir: "test", + } + + networks := json.RawMessage("{}") + setting := settings.Settings{ + Address: types.HexToAddress("0x1122334455667788990011223344556677889900"), + AnonMetricsShouldSend: false, + CurrentNetwork: "mainnet_rpc", + DappsAddress: types.HexToAddress("0x1122334455667788990011223344556677889900"), + InstallationID: "d3efcff6-cffa-560e-a547-21d3858cbc51", + KeyUID: "0x1122334455667788990011223344556677889900", + Name: "Test", + Networks: &networks, + PhotoPath: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAIAAACRXR/mAAAAjklEQVR4nOzXwQmFMBAAUZXUYh32ZB32ZB02sxYQQSZGsod55/91WFgSS0RM+SyjA56ZRZhFmEWYRRT6h+M6G16zrxv6fdJpmUWYRbxsYr13dKfanpN0WmYRZhGzXz6AWYRZRIfbaX26fT9Jk07LLMIsosPt9I/dTDotswizCG+nhFmEWYRZhFnEHQAA///z1CFkYamgfQAAAABJRU5ErkJggg==", + PreviewPrivacy: false, + PublicKey: "0x04112233445566778899001122334455667788990011223344556677889900112233445566778899001122334455667788990011223344556677889900", + SigningPhrase: "yurt joey vibe", + SendPushNotifications: true, + ProfilePicturesVisibility: 1, + DefaultSyncPeriod: 777600, + UseMailservers: true, + LinkPreviewRequestEnabled: true, + SendStatusUpdates: true, + WalletRootAddress: types.HexToAddress("0x1122334455667788990011223344556677889900")} + + _ = m.settings.CreateSettings(setting, config) + + return m +} + +func (s *AdminMessengerCommunitiesSuite) newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey) *Messenger { + tmpfile, err := ioutil.TempFile("", "accounts-tests-") + s.Require().NoError(err) + madb, err := multiaccounts.InitializeDB(tmpfile.Name()) + s.Require().NoError(err) + + acc := generator.NewAccount(privateKey, nil) + iai := acc.ToIdentifiedAccountInfo("") + + options := []Option{ + WithCustomLogger(s.logger), + WithDatabaseConfig(":memory:", "somekey", sqlite.ReducedKDFIterationsNumber), + WithMultiAccounts(madb), + WithAccount(iai.ToMultiAccount()), + WithDatasync(), + } + return s.newMessengerWithOptions(shh, privateKey, options) +} + +func (s *AdminMessengerCommunitiesSuite) newMessenger() *Messenger { + privateKey, err := crypto.GenerateKey() + s.Require().NoError(err) + + return s.newMessengerWithKey(s.shh, privateKey) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminEditCommunityDescription() { + // TODO admin test: update to include edit tags, logo, banner, request to join required setting, pin setting, etc... + community := s.setUpCommunityAndRoles() + s.adminEditsCommunityDescription(community) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCreateEditDeleteChannels() { + community := s.setUpCommunityAndRoles() + + newAdminChat := &protobuf.CommunityChat{ + Permissions: &protobuf.CommunityPermissions{ + Access: protobuf.CommunityPermissions_NO_MEMBERSHIP, + }, + Identity: &protobuf.ChatIdentity{ + DisplayName: "chat from admin", + Emoji: "", + Description: "chat created by an admin", + }, + } + + newChatID := s.adminCreateCommunityChannel(community, newAdminChat) + + newAdminChat.Identity.DisplayName = "modified chat from admin" + s.adminEditCommunityChannel(community, newAdminChat, newChatID) + + s.adminDeleteCommunityChannel(community, newChatID) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCreateBecomeMemberPermission() { + community := s.setUpCommunityAndRoles() + s.adminCreateTestTokenPermission(community) + + response, err := WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive community", + ) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(response.Communities()[0]) + + ownerCommunity, err := s.owner.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(ownerCommunity) + + response, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive community", + ) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(response.Communities()[0]) + + aliceCommunity, err := s.alice.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(aliceCommunity) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminEditBecomeMemberPermission() { + // first, create token permission + community := s.setUpCommunityAndRoles() + tokenPermissionID, createTokenPermission := s.adminCreateTestTokenPermission(community) + + // then, ensure owner receives it + _, err := WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive community", + ) + s.Require().NoError(err) + ownerCommunity, err := s.owner.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(ownerCommunity) + + // then, ensure alice receives it + _, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive community", + ) + s.Require().NoError(err) + aliceCommunity, err := s.alice.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(aliceCommunity) + + createTokenPermission.TokenCriteria[0].Symbol = "UPDATED" + createTokenPermission.TokenCriteria[0].Amount = "200" + + editTokenPermission := &requests.EditCommunityTokenPermission{ + PermissionID: tokenPermissionID, + CreateCommunityTokenPermission: *createTokenPermission, + } + + s.refreshMessengerResponses() + // then, admin edits the permission + response, err := s.admin.EditCommunityTokenPermission(editTokenPermission) + s.Require().NoError(err) + s.Require().Len(response.Communities(), 1) + s.assertAdminTokenPermissionEdited(response.Communities()[0]) + + // then, ensure owner receives and applies edits + response, err = WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive updated community", + ) + s.Require().NoError(err) + s.assertAdminTokenPermissionEdited(response.Communities()[0]) + ownerCommunity, err = s.owner.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionEdited(ownerCommunity) + + // then, ensure alice receives and applies edits + response, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive updated community", + ) + s.Require().NoError(err) + s.assertAdminTokenPermissionEdited(response.Communities()[0]) + aliceCommunity, err = s.alice.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionEdited(aliceCommunity) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminDeleteBecomeMemberPermission() { + community := s.setUpCommunityAndRoles() + tokenPermissionID, _ := s.adminCreateTestTokenPermission(community) + + // then, ensure owner receives it + _, err := WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive community", + ) + s.Require().NoError(err) + ownerCommunity, err := s.owner.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(ownerCommunity) + + // then, ensure alice receives it + _, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive community", + ) + s.Require().NoError(err) + aliceCommunity, err := s.alice.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(aliceCommunity) + + deleteTokenPermission := &requests.DeleteCommunityTokenPermission{ + CommunityID: community.ID(), + PermissionID: tokenPermissionID, + } + + s.refreshMessengerResponses() + + // then, admin deletes previously created token permission + _, err = s.admin.DeleteCommunityTokenPermission(deleteTokenPermission) + s.Require().NoError(err) + adminCommunity, err := s.admin.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.Require().Len(adminCommunity.TokenPermissions(), 0) + + // then, ensure owner receives and applies deletion + _, err = WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive updated community", + ) + s.Require().NoError(err) + ownerCommunity, err = s.owner.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.Require().Len(ownerCommunity.TokenPermissions(), 0) + + // then, ensure alice receives and applies deletion + _, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive updated community", + ) + s.Require().NoError(err) + aliceCommunity, err = s.alice.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.Require().Len(aliceCommunity.TokenPermissions(), 0) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCannotCreateBecomeAdminPermission() { + community := s.setUpCommunityAndRoles() + + permissionRequest := createTestPermissionRequest(community) + permissionRequest.Type = protobuf.CommunityTokenPermission_BECOME_ADMIN + + response, err := s.admin.CreateCommunityTokenPermission(permissionRequest) + s.Require().Nil(response) + s.Require().Error(err) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCannotEditBecomeAdminPermission() { + + community := s.setUpCommunityAndRoles() + permissionRequest := createTestPermissionRequest(community) + permissionRequest.Type = protobuf.CommunityTokenPermission_BECOME_ADMIN + + // owner creates BECOME_ADMIN permission + response, err := s.owner.CreateCommunityTokenPermission(permissionRequest) + s.Require().NoError(err) + + var tokenPermissionID string + for id := range response.CommunityChanges[0].TokenPermissionsAdded { + tokenPermissionID = id + } + s.Require().NotEqual(tokenPermissionID, "") + + ownerCommunity, err := s.owner.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(ownerCommunity) + + // then, ensure admin receives updated community + _, err = WaitOnMessengerResponse( + s.admin, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "admin did not receive updated community", + ) + s.Require().NoError(err) + adminCommunity, err := s.admin.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(adminCommunity) + + permissionRequest.TokenCriteria[0].Symbol = "UPDATED" + permissionRequest.TokenCriteria[0].Amount = "200" + + permissionEditRequest := &requests.EditCommunityTokenPermission{ + PermissionID: tokenPermissionID, + CreateCommunityTokenPermission: *permissionRequest, + } + + // then, admin tries to edit permission + response, err = s.admin.EditCommunityTokenPermission(permissionEditRequest) + s.Require().Error(err) + s.Require().Nil(response) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCannotDeleteBecomeAdminPermission() { + + community := s.setUpCommunityAndRoles() + permissionRequest := createTestPermissionRequest(community) + permissionRequest.Type = protobuf.CommunityTokenPermission_BECOME_ADMIN + + // owner creates BECOME_ADMIN permission + response, err := s.owner.CreateCommunityTokenPermission(permissionRequest) + s.Require().NoError(err) + + var tokenPermissionID string + for id := range response.CommunityChanges[0].TokenPermissionsAdded { + tokenPermissionID = id + } + s.Require().NotEqual(tokenPermissionID, "") + + // then, ensure admin receives updated community + _, err = WaitOnMessengerResponse( + s.admin, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "admin did not receive updated community", + ) + s.Require().NoError(err) + adminCommunity, err := s.admin.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + s.assertAdminTokenPermissionCreated(adminCommunity) + + deleteTokenPermission := &requests.DeleteCommunityTokenPermission{ + CommunityID: community.ID(), + PermissionID: tokenPermissionID, + } + + // then admin tries to delete BECOME_ADMIN permission which should fail + response, err = s.admin.DeleteCommunityTokenPermission(deleteTokenPermission) + s.Require().Error(err) + s.Require().Nil(response) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminAcceptMemberRequestToJoin() { + community := s.setUpOnRequestCommunityAndRoles() + + // set up additional user that will send request to join + user := s.newMessenger() + _, err := user.Start() + s.Require().NoError(err) + + s.advertiseCommunityTo(community, user) + + // user sends request to join + requestToJoin := &requests.RequestToJoinCommunity{CommunityID: community.ID()} + response, err := user.RequestToJoinCommunity(requestToJoin) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.RequestsToJoinCommunity, 1) + _ = response.RequestsToJoinCommunity[0] + + // admin receives request to join + response, err = WaitOnMessengerResponse( + s.admin, + func(r *MessengerResponse) bool { return len(r.RequestsToJoinCommunity) > 0 }, + "admin did not receive community request to join", + ) + s.Require().NoError(err) + s.Require().Len(response.RequestsToJoinCommunity, 1) + + receivedRequest := response.RequestsToJoinCommunity[0] + + // admin has not accepted request yet + adminCommunity, err := s.admin.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.Require().False(adminCommunity.HasMember(&user.identity.PublicKey)) + + acceptRequestToJoin := &requests.AcceptRequestToJoinCommunity{ID: receivedRequest.ID} + response, err = s.admin.AcceptRequestToJoinCommunity(acceptRequestToJoin) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.Communities(), 1) + s.Require().True(response.Communities()[0].HasMember(&user.identity.PublicKey)) + + // user receives request to join response + response, err = WaitOnMessengerResponse( + user, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "user did not receive community request to join response", + ) + s.Require().NoError(err) + s.Require().Len(response.Communities(), 1) + s.Require().True(response.Communities()[0].HasMember(&user.identity.PublicKey)) + + // owner receives updated community + response, err = WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive community request to join response", + ) + s.Require().NoError(err) + s.Require().Len(response.Communities(), 1) + + requests, err := s.owner.AcceptedRequestsToJoinForCommunity(community.ID()) + // there's now two requests to join (admin and alice) + 1 from user + s.Require().NoError(err) + s.Require().Len(requests, 3) + s.Require().True(response.Communities()[0].HasMember(&user.identity.PublicKey)) + + // alice receives updated community + response, err = WaitOnMessengerResponse( + s.alice, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "alice did not receive community request to join response", + ) + s.Require().NoError(err) + s.Require().Len(response.Communities(), 1) + s.Require().True(response.Communities()[0].HasMember(&user.identity.PublicKey)) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminRejectMemberRequestToJoin() { + community := s.setUpOnRequestCommunityAndRoles() + + // set up additional user that will send request to join + user := s.newMessenger() + _, err := user.Start() + s.Require().NoError(err) + + s.advertiseCommunityTo(community, user) + + // user sends request to join + requestToJoin := &requests.RequestToJoinCommunity{CommunityID: community.ID()} + response, err := user.RequestToJoinCommunity(requestToJoin) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.RequestsToJoinCommunity, 1) + + // admin receives request to join + response, err = WaitOnMessengerResponse( + s.admin, + func(r *MessengerResponse) bool { return len(r.RequestsToJoinCommunity) > 0 }, + "admin did not receive community request to join", + ) + s.Require().NoError(err) + s.Require().Len(response.RequestsToJoinCommunity, 1) + + receivedRequest := response.RequestsToJoinCommunity[0] + + // admin has not accepted request yet + adminCommunity, err := s.admin.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.Require().False(adminCommunity.HasMember(&user.identity.PublicKey)) + + // admin rejects request to join + rejectRequestToJoin := &requests.DeclineRequestToJoinCommunity{ID: receivedRequest.ID} + _, err = s.admin.DeclineRequestToJoinCommunity(rejectRequestToJoin) + s.Require().NoError(err) + + adminCommunity, err = s.admin.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.Require().False(adminCommunity.HasMember(&user.identity.PublicKey)) + + // owner receives admin event and stores rejected request to join + response, err = WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { return len(r.Communities()) > 0 }, + "owner did not receive community request to join update from admin", + ) + s.Require().NoError(err) + s.Require().False(response.Communities()[0].HasMember(&user.identity.PublicKey)) + + requests, err := s.owner.DeclinedRequestsToJoinForCommunity(community.ID()) + s.Require().Len(requests, 1) + s.Require().NoError(err) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminCreateEditDeleteCategories() { + community := s.setUpCommunityAndRoles() + newCategory := &requests.CreateCommunityCategory{ + CommunityID: community.ID(), + CategoryName: "admin-category-name", + } + categoryID := s.adminCreateCommunityCategory(community, newCategory) + + editCategory := &requests.EditCommunityCategory{ + CommunityID: community.ID(), + CategoryID: categoryID, + CategoryName: "edited-admin-category-name", + } + + s.adminEditCommunityCategory(community.IDString(), editCategory) + + deleteCategory := &requests.DeleteCommunityCategory{ + CommunityID: community.ID(), + CategoryID: categoryID, + } + + s.adminDeleteCommunityCategory(community.IDString(), deleteCategory) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminReorderChannelsAndCategories() { + community := s.setUpCommunityAndRoles() + newCategory := &requests.CreateCommunityCategory{ + CommunityID: community.ID(), + CategoryName: "admin-category-name", + } + _ = s.adminCreateCommunityCategory(community, newCategory) + + newCategory.CategoryName = "admin-category-name2" + categoryID2 := s.adminCreateCommunityCategory(community, newCategory) + + chat := &protobuf.CommunityChat{ + Permissions: &protobuf.CommunityPermissions{ + Access: protobuf.CommunityPermissions_NO_MEMBERSHIP, + }, + Identity: &protobuf.ChatIdentity{ + DisplayName: "chat from admin", + Emoji: "", + Description: "chat created by an admin", + }, + } + + chatID := s.adminCreateCommunityChannel(community, chat) + + reorderCommunityRequest := requests.ReorderCommunityCategories{ + CommunityID: community.ID(), + CategoryID: categoryID2, + Position: 0, + } + + s.adminReorderCategory(&reorderCommunityRequest) + + reorderChatRequest := requests.ReorderCommunityChat{ + CommunityID: community.ID(), + CategoryID: categoryID2, + ChatID: chatID, + Position: 0, + } + + s.adminReorderChannel(&reorderChatRequest) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminKickMember() { + community := s.setUpCommunityAndRoles() + + // admin tries to kick the owner + _, err := s.admin.RemoveUserFromCommunity( + community.ID(), + common.PubkeyToHex(&s.owner.identity.PublicKey), + ) + s.Require().Error(err) + + s.adminKickAlice(community.ID(), common.PubkeyToHex(&s.alice.identity.PublicKey)) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminBanUnbanMember() { + community := s.setUpCommunityAndRoles() + + // verify that admin can't ban an owner + _, err := s.admin.BanUserFromCommunity( + &requests.BanUserFromCommunity{ + CommunityID: community.ID(), + User: common.PubkeyToHexBytes(&s.owner.identity.PublicKey), + }, + ) + s.Require().Error(err) + + banRequest := &requests.BanUserFromCommunity{ + CommunityID: community.ID(), + User: common.PubkeyToHexBytes(&s.alice.identity.PublicKey), + } + + s.adminBanAlice(banRequest) + + unbanRequest := &requests.UnbanUserFromCommunity{ + CommunityID: community.ID(), + User: common.PubkeyToHexBytes(&s.alice.identity.PublicKey), + } + + s.adminUnbanAlice(unbanRequest) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminDeleteAnyMessageInTheCommunity() { + community := s.setUpCommunityAndRoles() + chatID := community.ChatIDs()[0] + + inputMessage := common.Message{} + inputMessage.ChatId = chatID + inputMessage.ContentType = protobuf.ChatMessage_TEXT_PLAIN + inputMessage.Text = "owner text" + + messageID := s.ownerSendMessage(&inputMessage) + + s.adminDeleteMessage(messageID) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminPinMessage() { + community := s.setUpCommunityAndRoles() + s.Require().False(community.AllowsAllMembersToPinMessage()) + chatID := community.ChatIDs()[0] + + inputMessage := common.Message{} + inputMessage.ChatId = chatID + inputMessage.ContentType = protobuf.ChatMessage_TEXT_PLAIN + inputMessage.Text = "owner text" + + messageID := s.ownerSendMessage(&inputMessage) + + pinnedMessage := common.PinMessage{} + pinnedMessage.MessageId = messageID + pinnedMessage.ChatId = chatID + pinnedMessage.Pinned = true + + s.adminPinMessage(&pinnedMessage) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminMintToken() { + s.setUpCommunityAndRoles() + // TODO admin test: Mint Tokens (rescticted) +} + +func (s *AdminMessengerCommunitiesSuite) TestAdminAirdropTokens() { + s.setUpCommunityAndRoles() + // TODO admin test: Airdrop Tokens (restricted) +} + +func (s *AdminMessengerCommunitiesSuite) setUpOnRequestCommunityAndRoles() *communities.Community { + tcs2, err := s.owner.communitiesManager.All() + s.Require().NoError(err, "admin.communitiesManager.All") + s.Len(tcs2, 1, "Must have 1 community") + + // owner creates a community and chat + community := s.createCommunity(protobuf.CommunityPermissions_ON_REQUEST) + s.advertiseCommunityTo(community, s.admin) + s.advertiseCommunityTo(community, s.alice) + + s.refreshMessengerResponses() + + s.joinOnRequestCommunity(community, s.admin) + s.joinOnRequestCommunity(community, s.alice) + + s.refreshMessengerResponses() + + // grant admin permissions to the admin + s.grantAdminPermissions(community, s.admin) + return community +} + +func (s *AdminMessengerCommunitiesSuite) setUpCommunityAndRoles() *communities.Community { + tcs2, err := s.owner.communitiesManager.All() + s.Require().NoError(err, "admin.communitiesManager.All") + s.Len(tcs2, 1, "Must have 1 community") + + // owner creates a community and chat + community := s.createCommunity(protobuf.CommunityPermissions_NO_MEMBERSHIP) + //_ = s.createCommunityChat(community) + s.refreshMessengerResponses() + + // add admin and alice to the community + s.advertiseCommunityTo(community, s.admin) + s.advertiseCommunityTo(community, s.alice) + s.joinCommunity(community, s.admin) + s.joinCommunity(community, s.alice) + + s.refreshMessengerResponses() + + // grant admin permissions to the admin + s.grantAdminPermissions(community, s.admin) + + return community +} + +func (s *AdminMessengerCommunitiesSuite) advertiseCommunityTo(community *communities.Community, user *Messenger) { + chat := CreateOneToOneChat(common.PubkeyToHex(&user.identity.PublicKey), &user.identity.PublicKey, user.transport) + + inputMessage := &common.Message{} + inputMessage.ChatId = chat.ID + inputMessage.Text = "some text" + inputMessage.CommunityID = community.IDString() + + err := s.owner.SaveChat(chat) + s.Require().NoError(err) + _, err = s.owner.SendChatMessage(context.Background(), inputMessage) + s.Require().NoError(err) + + // Ensure community is received + err = tt.RetryWithBackOff(func() error { + response, err := user.RetrieveAll() + if err != nil { + return err + } + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + return nil + }) + s.Require().NoError(err) +} + +func (s *AdminMessengerCommunitiesSuite) joinOnRequestCommunity(community *communities.Community, user *Messenger) { + // Request to join the community + request := &requests.RequestToJoinCommunity{CommunityID: community.ID()} + response, err := user.RequestToJoinCommunity(request) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.RequestsToJoinCommunity, 1) + + requestToJoin := response.RequestsToJoinCommunity[0] + s.Require().Equal(requestToJoin.PublicKey, common.PubkeyToHex(&user.identity.PublicKey)) + + response, err = WaitOnMessengerResponse( + s.owner, + func(r *MessengerResponse) bool { + return len(r.RequestsToJoinCommunity) > 0 + }, + "owner did not receive community request to join", + ) + s.Require().NoError(err) + + userRequestToJoin := response.RequestsToJoinCommunity[0] + s.Require().Equal(userRequestToJoin.PublicKey, common.PubkeyToHex(&user.identity.PublicKey)) + + // accept join request + acceptRequestToJoin := &requests.AcceptRequestToJoinCommunity{ID: requestToJoin.ID} + response, err = s.owner.AcceptRequestToJoinCommunity(acceptRequestToJoin) + s.Require().NoError(err) + s.Require().NotNil(response) + + updatedCommunity := response.Communities()[0] + s.Require().NotNil(updatedCommunity) + s.Require().True(updatedCommunity.HasMember(&user.identity.PublicKey)) + + // receive request to join response + _, err = WaitOnMessengerResponse( + user, + func(r *MessengerResponse) bool { + return len(r.Communities()) > 0 + }, + "user did not receive request to join response", + ) + s.Require().NoError(err) + userCommunity, err := user.GetCommunityByID(community.ID()) + s.Require().NoError(err) + s.Require().True(userCommunity.HasMember(&user.identity.PublicKey)) +} + +func (s *AdminMessengerCommunitiesSuite) joinCommunity(community *communities.Community, user *Messenger) { + // Request to join the community + request := &requests.RequestToJoinCommunity{CommunityID: community.ID()} + response, err := user.RequestToJoinCommunity(request) + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.RequestsToJoinCommunity, 1) + s.Require().Len(response.ActivityCenterNotifications(), 1) + + notification := response.ActivityCenterNotifications()[0] + s.Require().NotNil(notification) + s.Require().Equal(notification.Type, ActivityCenterNotificationTypeCommunityRequest) + s.Require().Equal(notification.MembershipStatus, ActivityCenterMembershipStatusPending) + + // Retrieve and accept join request + err = tt.RetryWithBackOff(func() error { + response, err := s.owner.RetrieveAll() + if err != nil { + return err + } + if len(response.Communities()) == 0 { + return errors.New("no communities in response (accept join request)") + } + if !response.Communities()[0].HasMember(&user.identity.PublicKey) { + return errors.New("user not accepted") + } + return nil + }) + s.Require().NoError(err) + + // Retrieve join request response + err = tt.RetryWithBackOff(func() error { + response, err := user.RetrieveAll() + + if err != nil { + return err + } + if len(response.Communities()) == 0 { + return errors.New("no communities in response (join request response)") + } + if !response.Communities()[0].HasMember(&user.identity.PublicKey) { + return errors.New("user not a member") + } + return nil + }) + s.Require().NoError(err) +} + +func (s *AdminMessengerCommunitiesSuite) createCommunity(membershipType protobuf.CommunityPermissions_Access) *communities.Community { + description := &requests.CreateCommunity{ + Membership: membershipType, + Name: "status", + Color: "#ffffff", + Description: "status community description", + PinMessageAllMembersEnabled: false, + } + response, err := s.owner.CreateCommunity(description, true) + + s.Require().NoError(err) + s.Require().NotNil(response) + s.Require().Len(response.Communities(), 1) + s.Require().Len(response.Chats(), 1) + + return response.Communities()[0] +} + +func (s *AdminMessengerCommunitiesSuite) grantAdminPermissions(community *communities.Community, target *Messenger) { + responseAddRole, err := s.owner.AddRoleToMember(&requests.AddRoleToMember{ + CommunityID: community.ID(), + User: common.PubkeyToHexBytes(target.IdentityPublicKey()), + Role: protobuf.CommunityMember_ROLE_ADMIN, + }) + s.Require().NoError(err) + + checkAdminRole := func(response *MessengerResponse) bool { + if len(response.Communities()) == 0 { + return false + } + rCommunities := response.Communities() + s.Require().Len(rCommunities, 1) + s.Require().True(rCommunities[0].IsMemberAdmin(target.IdentityPublicKey())) + return true + } + + checkAdminRole(responseAddRole) + + _, err = WaitOnMessengerResponse(s.admin, func(response *MessengerResponse) bool { + return checkAdminRole(response) + }, "community description changed message not received") + s.Require().NoError(err) + _, err = WaitOnMessengerResponse(s.alice, func(response *MessengerResponse) bool { + return checkAdminRole(response) + }, "community description changed message not received") + s.Require().NoError(err) + + s.refreshMessengerResponses() +} + +func (s *AdminMessengerCommunitiesSuite) adminEditsCommunityDescription(community *communities.Community) { + expectedName := "edited community name" + expectedColor := "#000000" + expectedDescr := "edited community description" + + response, err := s.admin.EditCommunity(&requests.EditCommunity{ + CommunityID: community.ID(), + CreateCommunity: requests.CreateCommunity{ + Membership: protobuf.CommunityPermissions_ON_REQUEST, + Name: expectedName, + Color: expectedColor, + Description: expectedDescr, + }, + }) + + checkCommunityEdit := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + rCommunities := response.Communities() + if expectedName != rCommunities[0].Name() { + return errors.New("incorrect community name") + } + + if expectedColor != rCommunities[0].Color() { + return errors.New("incorrect community color") + } + + if expectedDescr != rCommunities[0].DescriptionText() { + return errors.New("incorrect community description") + } + + return nil + } + + s.Require().NoError(err) + s.Require().Nil(checkCommunityEdit(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkCommunityEdit) +} + +func (s *AdminMessengerCommunitiesSuite) refreshMessengerResponses() { + _, err := WaitOnMessengerResponse(s.owner, func(response *MessengerResponse) bool { + return true + }, "community description changed message not received") + s.Require().NoError(err) + + _, err = WaitOnMessengerResponse(s.admin, func(response *MessengerResponse) bool { + return true + }, "community description changed message not received") + s.Require().NoError(err) + + _, err = WaitOnMessengerResponse(s.alice, func(response *MessengerResponse) bool { + return true + }, "community description changed message not received") + s.Require().NoError(err) +} + +type MessageResponseValidator func(*MessengerResponse) error +type WaitResponseValidator func(*MessengerResponse) bool + +func WaitCommunityCondition(r *MessengerResponse) bool { + return len(r.Communities()) > 0 +} + +func WaitMessageCondition(response *MessengerResponse) bool { + return len(response.Messages()) > 0 +} + +func (s *AdminMessengerCommunitiesSuite) checkClientsReceivedAdminEvent(fnWait WaitResponseValidator, fn MessageResponseValidator) { + response, err := WaitOnMessengerResponse( + s.alice, + fnWait, + "MessengerResponse data not received", + ) + s.Require().NoError(err) + s.Require().NoError(fn(response)) + + response, err = WaitOnMessengerResponse( + s.owner, + fnWait, + "MessengerResponse data not received", + ) + s.Require().NoError(err) + s.Require().NoError(fn(response)) + + s.refreshMessengerResponses() +} + +func (s *AdminMessengerCommunitiesSuite) adminCreateTokenPermission(community *communities.Community, request *requests.CreateCommunityTokenPermission, assertFn func(*communities.Community)) (string, *requests.CreateCommunityTokenPermission) { + response, err := s.admin.CreateCommunityTokenPermission(request) + s.Require().NoError(err) + s.Require().Len(response.Communities(), 1) + + adminCommunity, err := s.admin.communitiesManager.GetByID(community.ID()) + s.Require().NoError(err) + assertFn(adminCommunity) + + var tokenPermissionID string + for id := range response.CommunityChanges[0].TokenPermissionsAdded { + tokenPermissionID = id + } + s.Require().NotEqual(tokenPermissionID, "") + + return tokenPermissionID, request +} + +func createTestPermissionRequest(community *communities.Community) *requests.CreateCommunityTokenPermission { + return &requests.CreateCommunityTokenPermission{ + CommunityID: community.ID(), + Type: protobuf.CommunityTokenPermission_BECOME_MEMBER, + TokenCriteria: []*protobuf.TokenCriteria{ + &protobuf.TokenCriteria{ + Type: protobuf.CommunityTokenType_ERC20, + ContractAddresses: map[uint64]string{uint64(1): "0x123"}, + Symbol: "TEST", + Amount: "100", + Decimals: uint64(18), + }, + }, + } +} + +func (s *AdminMessengerCommunitiesSuite) adminCreateTestTokenPermission(community *communities.Community) (string, *requests.CreateCommunityTokenPermission) { + createTokenPermission := createTestPermissionRequest(community) + return s.adminCreateTokenPermission(community, createTokenPermission, s.assertAdminTokenPermissionCreated) +} + +func (s *AdminMessengerCommunitiesSuite) assertAdminTokenPermissionCreated(community *communities.Community) { + permissions := make([]*protobuf.CommunityTokenPermission, 0) + tokenPermissions := community.TokenPermissions() + for _, p := range tokenPermissions { + permissions = append(permissions, p) + } + s.Require().Len(permissions, 1) + s.Require().Len(permissions[0].TokenCriteria, 1) + s.Require().Equal(permissions[0].TokenCriteria[0].Type, protobuf.CommunityTokenType_ERC20) + s.Require().Equal(permissions[0].TokenCriteria[0].Symbol, "TEST") + s.Require().Equal(permissions[0].TokenCriteria[0].Amount, "100") + s.Require().Equal(permissions[0].TokenCriteria[0].Decimals, uint64(18)) +} + +func (s *AdminMessengerCommunitiesSuite) assertAdminTokenPermissionEdited(community *communities.Community) { + permissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + s.Require().Len(permissions, 1) + s.Require().Len(permissions[0].TokenCriteria, 1) + s.Require().Equal(permissions[0].TokenCriteria[0].Type, protobuf.CommunityTokenType_ERC20) + s.Require().Equal(permissions[0].TokenCriteria[0].Symbol, "UPDATED") + s.Require().Equal(permissions[0].TokenCriteria[0].Amount, "200") + s.Require().Equal(permissions[0].TokenCriteria[0].Decimals, uint64(18)) +} + +func (s *AdminMessengerCommunitiesSuite) adminCreateCommunityChannel(community *communities.Community, newChannel *protobuf.CommunityChat) string { + checkChannelCreated := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == community.IDString() { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + for _, chat := range modifiedCommmunity.Chats() { + if chat.GetIdentity().GetDisplayName() == newChannel.GetIdentity().GetDisplayName() { + return nil + } + } + + return errors.New("couldn't find created chat in response") + } + + response, err := s.admin.CreateCommunityChat(community.ID(), newChannel) + s.Require().NoError(err) + s.Require().NoError(checkChannelCreated(response)) + s.Require().Len(response.CommunityChanges, 1) + s.Require().Len(response.CommunityChanges[0].ChatsAdded, 1) + var addedChatID string + for addedChatID = range response.CommunityChanges[0].ChatsAdded { + break + } + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkChannelCreated) + + return addedChatID +} + +func (s *AdminMessengerCommunitiesSuite) adminEditCommunityChannel(community *communities.Community, editChannel *protobuf.CommunityChat, channelID string) { + checkChannelEdited := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == community.IDString() { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + for _, chat := range modifiedCommmunity.Chats() { + if chat.GetIdentity().GetDisplayName() == editChannel.GetIdentity().GetDisplayName() { + return nil + } + } + + return errors.New("couldn't find modified chat in response") + } + + _, err := WaitOnMessengerResponse(s.admin, func(response *MessengerResponse) bool { + return true + }, "community description changed message not received") + s.Require().NoError(err) + + response, err := s.admin.EditCommunityChat(community.ID(), channelID, editChannel) + s.Require().NoError(err) + s.Require().NoError(checkChannelEdited(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkChannelEdited) +} + +func (s *AdminMessengerCommunitiesSuite) adminDeleteCommunityChannel(community *communities.Community, channelID string) { + checkChannelDeleted := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == community.IDString() { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + if _, exists := modifiedCommmunity.Chats()[channelID]; exists { + return errors.New("channel was not deleted") + } + + return nil + } + + response, err := s.admin.DeleteCommunityChat(community.ID(), channelID) + s.Require().NoError(err) + s.Require().NoError(checkChannelDeleted(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkChannelDeleted) +} + +func (s *AdminMessengerCommunitiesSuite) adminCreateCommunityCategory(community *communities.Community, newCategory *requests.CreateCommunityCategory) string { + checkCategoryCreated := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == community.IDString() { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + for _, category := range modifiedCommmunity.Categories() { + if category.GetName() == newCategory.CategoryName { + return nil + } + } + + return errors.New("couldn't find created Category in the response") + } + + response, err := s.admin.CreateCommunityCategory(newCategory) + s.Require().NoError(err) + s.Require().NoError(checkCategoryCreated(response)) + s.Require().Len(response.Communities(), 1) + s.Require().Len(response.CommunityChanges[0].CategoriesAdded, 1) + + var categoryID string + for categoryID = range response.CommunityChanges[0].CategoriesAdded { + break + } + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkCategoryCreated) + + return categoryID +} + +func (s *AdminMessengerCommunitiesSuite) adminEditCommunityCategory(communityID string, editCategory *requests.EditCommunityCategory) { + checkCategoryEdited := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == communityID { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + for _, category := range modifiedCommmunity.Categories() { + if category.GetName() == editCategory.CategoryName { + return nil + } + } + + return errors.New("couldn't find created Category in the response") + } + + response, err := s.admin.EditCommunityCategory(editCategory) + s.Require().NoError(err) + s.Require().NoError(checkCategoryEdited(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkCategoryEdited) +} + +func (s *AdminMessengerCommunitiesSuite) adminDeleteCommunityCategory(communityID string, deleteCategory *requests.DeleteCommunityCategory) { + checkCategoryDeleted := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == communityID { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + if _, exists := modifiedCommmunity.Chats()[deleteCategory.CategoryID]; exists { + return errors.New("community was not deleted") + } + + return nil + } + + response, err := s.admin.DeleteCommunityCategory(deleteCategory) + s.Require().NoError(err) + s.Require().NoError(checkCategoryDeleted(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkCategoryDeleted) +} + +func (s *AdminMessengerCommunitiesSuite) ownerSendMessage(inputMessage *common.Message) string { + response, err := s.owner.SendChatMessage(context.Background(), inputMessage) + s.Require().NoError(err) + message := response.Messages()[0] + s.Require().Equal(inputMessage.Text, message.Text) + messageID := message.ID + + response, err = WaitOnMessengerResponse(s.admin, WaitMessageCondition, "messages not received") + s.Require().NoError(err) + message = response.Messages()[0] + s.Require().Equal(inputMessage.Text, message.Text) + + response, err = WaitOnMessengerResponse(s.alice, WaitMessageCondition, "messages not received") + s.Require().NoError(err) + message = response.Messages()[0] + s.Require().Equal(inputMessage.Text, message.Text) + + s.refreshMessengerResponses() + + return messageID +} + +func (s *AdminMessengerCommunitiesSuite) adminDeleteMessage(messageID string) { + checkMessageDeleted := func(response *MessengerResponse) error { + if len(response.RemovedMessages()) > 0 { + return nil + } + return errors.New("message was not deleted") + } + + response, err := s.admin.DeleteMessageAndSend(context.Background(), messageID) + s.Require().NoError(err) + s.Require().NoError(checkMessageDeleted(response)) + + waitMessageCondition := func(response *MessengerResponse) bool { + return len(response.RemovedMessages()) > 0 + } + s.checkClientsReceivedAdminEvent(waitMessageCondition, checkMessageDeleted) +} + +func (s *AdminMessengerCommunitiesSuite) adminPinMessage(pinnedMessage *common.PinMessage) { + checkPinned := func(response *MessengerResponse) error { + if len(response.PinMessages()) > 0 { + return nil + } + return errors.New("pin messages was not added") + } + + response, err := s.admin.SendPinMessage(context.Background(), pinnedMessage) + s.Require().NoError(err) + s.Require().NoError(checkPinned(response)) + + s.checkClientsReceivedAdminEvent(WaitMessageCondition, checkPinned) +} + +func (s *AdminMessengerCommunitiesSuite) adminBanAlice(banRequest *requests.BanUserFromCommunity) { + + checkBanned := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == types.EncodeHex(banRequest.CommunityID) { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + if modifiedCommmunity.HasMember(&s.alice.identity.PublicKey) { + return errors.New("alice was not removed from the member list") + } + + if !modifiedCommmunity.IsBanned(&s.alice.identity.PublicKey) { + return errors.New("alice was not added to the banned list") + } + + return nil + } + + response, err := s.admin.BanUserFromCommunity(banRequest) + s.Require().NoError(err) + s.Require().Nil(checkBanned(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkBanned) +} + +func (s *AdminMessengerCommunitiesSuite) adminUnbanAlice(unbanRequest *requests.UnbanUserFromCommunity) { + checkUnbanned := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == types.EncodeHex(unbanRequest.CommunityID) { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + if modifiedCommmunity.IsBanned(&s.alice.identity.PublicKey) { + return errors.New("alice was not unbanned") + } + + return nil + } + + response, err := s.admin.UnbanUserFromCommunity(unbanRequest) + s.Require().NoError(err) + s.Require().Nil(checkUnbanned(response)) + + response, err = WaitOnMessengerResponse( + s.owner, + WaitCommunityCondition, + "MessengerResponse data not received", + ) + s.Require().NoError(err) + s.Require().NoError(checkUnbanned(response)) +} + +func (s *AdminMessengerCommunitiesSuite) adminKickAlice(communityID types.HexBytes, pubkey string) { + checkKicked := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == types.EncodeHex(communityID) { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + if modifiedCommmunity.HasMember(&s.alice.identity.PublicKey) { + return errors.New("alice was not kicked") + } + + return nil + } + + response, err := s.admin.RemoveUserFromCommunity( + communityID, + pubkey, + ) + + s.Require().NoError(err) + s.Require().Nil(checkKicked(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkKicked) +} + +func (s *AdminMessengerCommunitiesSuite) adminReorderCategory(reorderRequest *requests.ReorderCommunityCategories) { + checkCategoryReorder := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == types.EncodeHex(reorderRequest.CommunityID) { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + category, exist := modifiedCommmunity.Categories()[reorderRequest.CategoryID] + if !exist { + return errors.New("couldn't find community category") + } + + if int(category.Position) != reorderRequest.Position { + return errors.New("category was not reordered") + } + + return nil + } + + response, err := s.admin.ReorderCommunityCategories(reorderRequest) + s.Require().NoError(err) + s.Require().NoError(checkCategoryReorder(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkCategoryReorder) +} + +func (s *AdminMessengerCommunitiesSuite) adminReorderChannel(reorderRequest *requests.ReorderCommunityChat) { + checkChannelReorder := func(response *MessengerResponse) error { + if len(response.Communities()) == 0 { + return errors.New("community not received") + } + + var modifiedCommmunity *communities.Community = nil + for _, c := range response.Communities() { + if c.IDString() == types.EncodeHex(reorderRequest.CommunityID) { + modifiedCommmunity = c + } + } + + if modifiedCommmunity == nil { + return errors.New("couldn't find community in response") + } + + chat, exist := modifiedCommmunity.Chats()[reorderRequest.ChatID] + if !exist { + return errors.New("couldn't find community chat") + } + + if int(chat.Position) != reorderRequest.Position { + return errors.New("chat position was not reordered") + } + + if chat.CategoryId != reorderRequest.CategoryID { + return errors.New("chat category was not reordered") + } + + return nil + } + + response, err := s.admin.ReorderCommunityChat(reorderRequest) + s.Require().NoError(err) + s.Require().NoError(checkChannelReorder(response)) + + s.checkClientsReceivedAdminEvent(WaitCommunityCondition, checkChannelReorder) +} diff --git a/protocol/communities_messenger_test.go b/protocol/communities_messenger_test.go index 932b80b05..08ff19bca 100644 --- a/protocol/communities_messenger_test.go +++ b/protocol/communities_messenger_test.go @@ -607,7 +607,7 @@ func (s *MessengerCommunitiesSuite) TestInviteUsersToCommunity() { s.Require().NotNil(response) s.Require().Len(response.Communities(), 1) s.Require().True(response.Communities()[0].HasMember(&s.bob.identity.PublicKey)) - s.Require().True(response.Communities()[0].IsMemberAdmin(&s.bob.identity.PublicKey)) + s.Require().True(response.Communities()[0].IsMemberOwner(&s.bob.identity.PublicKey)) community := response.Communities()[0] @@ -783,7 +783,7 @@ func (s *MessengerCommunitiesSuite) TestImportCommunity() { s.Require().Len(response.Communities(), 1) s.Require().Len(response.CommunitiesSettings(), 1) s.Require().True(response.Communities()[0].Joined()) - s.Require().True(response.Communities()[0].IsAdmin()) + s.Require().True(response.Communities()[0].IsOwner()) community := response.Communities()[0] communitySettings := response.CommunitiesSettings()[0] @@ -828,7 +828,7 @@ func (s *MessengerCommunitiesSuite) TestImportCommunity() { if len(response.Communities()) == 0 { return errors.New("community not received") } - if !response.Communities()[0].IsAdmin() { + if !response.Communities()[0].IsOwner() { return errors.New("isn't admin despite import") } return nil @@ -854,9 +854,9 @@ func (s *MessengerCommunitiesSuite) TestRolesAfterImportCommunity() { s.Require().Len(response.Communities(), 1) s.Require().Len(response.CommunitiesSettings(), 1) s.Require().True(response.Communities()[0].Joined()) - s.Require().True(response.Communities()[0].IsAdmin()) - s.Require().True(response.Communities()[0].IsMemberAdmin(&s.bob.identity.PublicKey)) - s.Require().False(response.Communities()[0].IsMemberAdmin(&s.alice.identity.PublicKey)) + s.Require().True(response.Communities()[0].IsOwner()) + s.Require().True(response.Communities()[0].IsMemberOwner(&s.bob.identity.PublicKey)) + s.Require().False(response.Communities()[0].IsMemberOwner(&s.alice.identity.PublicKey)) community := response.Communities()[0] communitySettings := response.CommunitiesSettings()[0] @@ -879,7 +879,7 @@ func (s *MessengerCommunitiesSuite) TestRolesAfterImportCommunity() { response, err = s.alice.ImportCommunity(ctx, privateKey) s.Require().NoError(err) - s.Require().True(response.Communities()[0].IsMemberAdmin(&s.alice.identity.PublicKey)) + s.Require().True(response.Communities()[0].IsMemberOwner(&s.alice.identity.PublicKey)) } func (s *MessengerCommunitiesSuite) TestRequestAccess() { @@ -2785,7 +2785,7 @@ func (s *MessengerCommunitiesSuite) TestSyncCommunity() { s.Equal(newCommunity.Muted(), tnc.Muted()) s.Equal(newCommunity.Joined(), tnc.Joined()) s.Equal(newCommunity.Spectated(), tnc.Spectated()) - s.Equal(newCommunity.IsAdmin(), tnc.IsAdmin()) + s.Equal(newCommunity.IsOwner(), tnc.IsOwner()) s.Equal(newCommunity.InvitationOnly(), tnc.InvitationOnly()) } diff --git a/protocol/encryption/migrations/migrations.go b/protocol/encryption/migrations/migrations.go index e47dc2b52..4282119fe 100644 --- a/protocol/encryption/migrations/migrations.go +++ b/protocol/encryption/migrations/migrations.go @@ -103,7 +103,7 @@ func _1536754952_initial_schemaDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1536754952_initial_schema.down.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1536754952_initial_schema.down.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x44, 0xcf, 0x76, 0x71, 0x1f, 0x5e, 0x9a, 0x43, 0xd8, 0xcd, 0xb8, 0xc3, 0x70, 0xc3, 0x7f, 0xfc, 0x90, 0xb4, 0x25, 0x1e, 0xf4, 0x66, 0x20, 0xb8, 0x33, 0x7e, 0xb0, 0x76, 0x1f, 0xc, 0xc0, 0x75}} return a, nil } @@ -123,7 +123,7 @@ func _1536754952_initial_schemaUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1536754952_initial_schema.up.sql", size: 962, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1536754952_initial_schema.up.sql", size: 962, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x90, 0x5a, 0x59, 0x3e, 0x3, 0xe2, 0x3c, 0x81, 0x42, 0xcd, 0x4c, 0x9a, 0xe8, 0xda, 0x93, 0x2b, 0x70, 0xa4, 0xd5, 0x29, 0x3e, 0xd5, 0xc9, 0x27, 0xb6, 0xb7, 0x65, 0xff, 0x0, 0xcb, 0xde}} return a, nil } @@ -143,7 +143,7 @@ func _1539249977_update_ratchet_infoDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1539249977_update_ratchet_info.down.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1539249977_update_ratchet_info.down.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0xa4, 0xeb, 0xa0, 0xe6, 0xa0, 0xd4, 0x48, 0xbb, 0xad, 0x6f, 0x7d, 0x67, 0x8c, 0xbd, 0x25, 0xde, 0x1f, 0x73, 0x9a, 0xbb, 0xa8, 0xc9, 0x30, 0xb7, 0xa9, 0x7c, 0xaf, 0xb5, 0x1, 0x61, 0xdd}} return a, nil } @@ -163,7 +163,7 @@ func _1539249977_update_ratchet_infoUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1539249977_update_ratchet_info.up.sql", size: 368, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1539249977_update_ratchet_info.up.sql", size: 368, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc, 0x8e, 0xbf, 0x6f, 0xa, 0xc0, 0xe1, 0x3c, 0x42, 0x28, 0x88, 0x1d, 0xdb, 0xba, 0x1c, 0x83, 0xec, 0xba, 0xd3, 0x5f, 0x5c, 0x77, 0x5e, 0xa7, 0x46, 0x36, 0xec, 0x69, 0xa, 0x4b, 0x17, 0x79}} return a, nil } @@ -183,7 +183,7 @@ func _1540715431_add_versionDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1540715431_add_version.down.sql", size: 127, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1540715431_add_version.down.sql", size: 127, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x9, 0x4, 0xe3, 0x76, 0x2e, 0xb8, 0x9, 0x23, 0xf0, 0x70, 0x93, 0xc4, 0x50, 0xe, 0x9d, 0x84, 0x22, 0x8c, 0x94, 0xd3, 0x24, 0x9, 0x9a, 0xc1, 0xa1, 0x48, 0x45, 0xfd, 0x40, 0x6e, 0xe6}} return a, nil } @@ -203,7 +203,7 @@ func _1540715431_add_versionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1540715431_add_version.up.sql", size: 265, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1540715431_add_version.up.sql", size: 265, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc7, 0x4c, 0x36, 0x96, 0xdf, 0x16, 0x10, 0xa6, 0x27, 0x1a, 0x79, 0x8b, 0x42, 0x83, 0x23, 0xc, 0x7e, 0xb6, 0x3d, 0x2, 0xda, 0xa4, 0xb4, 0xd, 0x27, 0x55, 0xba, 0xdc, 0xb2, 0x88, 0x8f, 0xa6}} return a, nil } @@ -223,7 +223,7 @@ func _1541164797_add_installationsDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1541164797_add_installations.down.sql", size: 26, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1541164797_add_installations.down.sql", size: 26, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0xfd, 0xe6, 0xd8, 0xca, 0x3b, 0x38, 0x18, 0xee, 0x0, 0x5f, 0x36, 0x9e, 0x1e, 0xd, 0x19, 0x3e, 0xb4, 0x73, 0x53, 0xe9, 0xa5, 0xac, 0xdd, 0xa1, 0x2f, 0xc7, 0x6c, 0xa8, 0xd9, 0xa, 0x88}} return a, nil } @@ -243,7 +243,7 @@ func _1541164797_add_installationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1541164797_add_installations.up.sql", size: 216, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1541164797_add_installations.up.sql", size: 216, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2d, 0x18, 0x26, 0xb8, 0x88, 0x47, 0xdb, 0x83, 0xcc, 0xb6, 0x9d, 0x1c, 0x1, 0xae, 0x2f, 0xde, 0x97, 0x82, 0x3, 0x30, 0xa8, 0x63, 0xa1, 0x78, 0x4b, 0xa5, 0x9, 0x8, 0x75, 0xa2, 0x57, 0x81}} return a, nil } @@ -263,7 +263,7 @@ func _1558084410_add_secretDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1558084410_add_secret.down.sql", size: 56, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1558084410_add_secret.down.sql", size: 56, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0xb, 0x65, 0xdf, 0x59, 0xbf, 0xe9, 0x5, 0x5b, 0x6f, 0xd5, 0x3a, 0xb7, 0x57, 0xe8, 0x78, 0x38, 0x73, 0x53, 0x57, 0xf7, 0x24, 0x4, 0xe4, 0xa2, 0x49, 0x22, 0xa2, 0xc6, 0xfd, 0x80, 0xa4}} return a, nil } @@ -283,7 +283,7 @@ func _1558084410_add_secretUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1558084410_add_secret.up.sql", size: 301, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1558084410_add_secret.up.sql", size: 301, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x32, 0x36, 0x8e, 0x47, 0xb0, 0x8f, 0xc1, 0xc6, 0xf7, 0xc6, 0x9f, 0x2d, 0x44, 0x75, 0x2b, 0x26, 0xec, 0x6, 0xa0, 0x7b, 0xa5, 0xbd, 0xc8, 0x76, 0x8a, 0x82, 0x68, 0x2, 0x42, 0xb5, 0xf4}} return a, nil } @@ -303,7 +303,7 @@ func _1558588866_add_versionDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1558588866_add_version.down.sql", size: 47, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1558588866_add_version.down.sql", size: 47, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x52, 0x34, 0x3c, 0x46, 0x4a, 0xf0, 0x72, 0x47, 0x6f, 0x49, 0x5c, 0xc7, 0xf9, 0x32, 0xce, 0xc4, 0x3d, 0xfd, 0x61, 0xa1, 0x8b, 0x8f, 0xf2, 0x31, 0x34, 0xde, 0x15, 0x49, 0xa6, 0xde, 0xb9}} return a, nil } @@ -323,7 +323,7 @@ func _1558588866_add_versionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1558588866_add_version.up.sql", size: 57, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1558588866_add_version.up.sql", size: 57, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2a, 0xea, 0x64, 0x39, 0x61, 0x20, 0x83, 0x83, 0xb, 0x2e, 0x79, 0x64, 0xb, 0x53, 0xfa, 0xfe, 0xc6, 0xf7, 0x67, 0x42, 0xd3, 0x4f, 0xdc, 0x7e, 0x30, 0x32, 0xe8, 0x14, 0x41, 0xe9, 0xe7, 0x3b}} return a, nil } @@ -343,7 +343,7 @@ func _1559627659_add_contact_codeDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1559627659_add_contact_code.down.sql", size: 32, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1559627659_add_contact_code.down.sql", size: 32, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5d, 0x64, 0x6d, 0xce, 0x24, 0x42, 0x20, 0x8d, 0x4f, 0x37, 0xaa, 0x9d, 0xc, 0x57, 0x98, 0xc1, 0xd1, 0x1a, 0x34, 0xcd, 0x9f, 0x8f, 0x34, 0x86, 0xb3, 0xd3, 0xdc, 0xf1, 0x7d, 0xe5, 0x1b, 0x6e}} return a, nil } @@ -363,7 +363,7 @@ func _1559627659_add_contact_codeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1559627659_add_contact_code.up.sql", size: 198, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1559627659_add_contact_code.up.sql", size: 198, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x16, 0xf6, 0xc2, 0x62, 0x9c, 0xd2, 0xc9, 0x1e, 0xd8, 0xea, 0xaa, 0xea, 0x95, 0x8f, 0x89, 0x6a, 0x85, 0x5d, 0x9d, 0x99, 0x78, 0x3c, 0x90, 0x66, 0x99, 0x3e, 0x4b, 0x19, 0x62, 0xfb, 0x31, 0x4d}} return a, nil } @@ -383,7 +383,7 @@ func _1561368210_add_installation_metadataDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1561368210_add_installation_metadata.down.sql", size: 35, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1561368210_add_installation_metadata.down.sql", size: 35, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0xde, 0x3f, 0xd2, 0x4a, 0x50, 0x98, 0x56, 0xe3, 0xc0, 0xcd, 0x9d, 0xb0, 0x34, 0x3b, 0xe5, 0x62, 0x18, 0xb5, 0x20, 0xc9, 0x3e, 0xdc, 0x6a, 0x40, 0x36, 0x66, 0xea, 0x51, 0x8c, 0x71, 0xf5}} return a, nil } @@ -403,7 +403,7 @@ func _1561368210_add_installation_metadataUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1561368210_add_installation_metadata.up.sql", size: 267, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1561368210_add_installation_metadata.up.sql", size: 267, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb4, 0x71, 0x8f, 0x29, 0xb1, 0xaa, 0xd6, 0xd1, 0x8c, 0x17, 0xef, 0x6c, 0xd5, 0x80, 0xb8, 0x2c, 0xc3, 0xfe, 0xec, 0x24, 0x4d, 0xc8, 0x25, 0xd3, 0xb4, 0xcd, 0xa9, 0xac, 0x63, 0x61, 0xb2, 0x9c}} return a, nil } @@ -423,7 +423,7 @@ func _1632236298_add_communitiesDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1632236298_add_communities.down.sql", size: 151, mode: os.FileMode(0644), modTime: time.Unix(1638783767, 0)} + info := bindataFileInfo{name: "1632236298_add_communities.down.sql", size: 151, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x26, 0xe5, 0x47, 0xd1, 0xe5, 0xec, 0x5b, 0x3e, 0xdc, 0x22, 0xf4, 0x27, 0xee, 0x70, 0xf3, 0x9, 0x4f, 0xd2, 0x9f, 0x92, 0xf, 0x5a, 0x18, 0x11, 0xb7, 0x40, 0xab, 0xf1, 0x98, 0x72, 0xd6, 0x60}} return a, nil } @@ -443,7 +443,7 @@ func _1632236298_add_communitiesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1632236298_add_communities.up.sql", size: 584, mode: os.FileMode(0644), modTime: time.Unix(1638783767, 0)} + info := bindataFileInfo{name: "1632236298_add_communities.up.sql", size: 584, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0xe0, 0x1, 0x6e, 0x84, 0xc, 0x35, 0xe4, 0x5a, 0xf, 0xbe, 0xcb, 0xf7, 0xd2, 0xa8, 0x25, 0xf5, 0xdb, 0x7, 0xcb, 0xa3, 0xe6, 0xf4, 0xc4, 0x1b, 0xa5, 0xec, 0x32, 0x1e, 0x1e, 0x48, 0x60}} return a, nil } @@ -463,7 +463,7 @@ func _1636536507_add_index_bundlesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1636536507_add_index_bundles.up.sql", size: 347, mode: os.FileMode(0644), modTime: time.Unix(1637051072, 0)} + info := bindataFileInfo{name: "1636536507_add_index_bundles.up.sql", size: 347, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf1, 0xb9, 0x3c, 0x16, 0xfc, 0xfb, 0xb2, 0xb4, 0x3b, 0xfe, 0xdc, 0xf5, 0x9c, 0x42, 0xa0, 0xa0, 0xd4, 0xd, 0x5b, 0x97, 0x10, 0x80, 0x95, 0xe, 0x13, 0xc1, 0x18, 0x8, 0xee, 0xf, 0x99, 0xee}} return a, nil } @@ -483,7 +483,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 377, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "doc.go", size: 377, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xef, 0xaf, 0xdf, 0xcf, 0x65, 0xae, 0x19, 0xfc, 0x9d, 0x29, 0xc1, 0x91, 0xaf, 0xb5, 0xd5, 0xb1, 0x56, 0xf3, 0xee, 0xa8, 0xba, 0x13, 0x65, 0xdb, 0xab, 0xcf, 0x4e, 0xac, 0x92, 0xe9, 0x60, 0xf1}} return a, nil } diff --git a/protocol/messenger.go b/protocol/messenger.go index eca1a7e5d..5657693db 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -1556,7 +1556,7 @@ func (m *Messenger) Init() error { continue } - if !org.IsAdmin() && !communitySettings.HistoryArchiveSupportEnabled { + if !org.IsOwner() && !communitySettings.HistoryArchiveSupportEnabled { communitySettings.HistoryArchiveSupportEnabled = true err = m.communitiesManager.UpdateCommunitySettings(*communitySettings) if err != nil { @@ -2231,7 +2231,7 @@ func (m *Messenger) updateChatFirstMessageTimestamp(chat *Chat, timestamp uint32 return err } - if community.IsAdmin() && chat.UpdateFirstMessageTimestamp(timestamp) { + if community.IsOwner() && chat.UpdateFirstMessageTimestamp(timestamp) { community, changes, err := m.communitiesManager.EditChatFirstMessageTimestamp(community.ID(), chat.ID, chat.FirstMessageTimestamp) if err != nil { return err @@ -4209,6 +4209,17 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte continue } + case protobuf.CommunityAdminEvent: + logger.Debug("Handling CommunityAdminEvent") + message := msg.ParsedMessage.Interface().(protobuf.CommunityAdminEvent) + m.outputToCSV(msg.TransportMessage.Timestamp, msg.ID, senderID, filter.Topic, filter.ChatID, msg.Type, message) + err = m.handleCommunityAdminEvent(messageState, publicKey, message, msg.DecryptedPayload) + if err != nil { + logger.Warn("failed to handle CommunityAdminEvent", zap.Error(err)) + allMessagesProcessed = false + continue + } + case protobuf.AnonymousMetricBatch: logger.Debug("Handling AnonymousMetricBatch") if m.anonMetricsServer == nil { diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 170131cee..bf161e422 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -102,6 +102,31 @@ func (m *Messenger) publishOrgInvitation(org *communities.Community, invitation return err } +func (m *Messenger) publishCommunityAdminEvent(adminEvent *protobuf.CommunityAdminEvent) error { + adminPubkey := common.PubkeyToHex(&m.identity.PublicKey) + m.logger.Debug("publishing community admin event", zap.String("admin-id", adminPubkey), zap.Any("event", adminEvent)) + _, err := crypto.DecompressPubkey(adminEvent.CommunityId) + if err != nil { + return err + } + + payload, err := proto.Marshal(adminEvent) + if err != nil { + return err + } + + rawMessage := common.RawMessage{ + Payload: payload, + Sender: m.identity, + // we don't want to wrap in an encryption layer message + SkipEncryption: true, + MessageType: protobuf.ApplicationMetadataMessage_COMMUNITY_ADMIN_MESSAGE, + } + + _, err = m.sender.SendPublic(context.Background(), types.EncodeHex(adminEvent.CommunityId), rawMessage) + return err +} + func (m *Messenger) handleCommunitiesHistoryArchivesSubscription(c chan *communities.Subscription) { go func() { @@ -141,7 +166,7 @@ func (m *Messenger) handleCommunitiesHistoryArchivesSubscription(c chan *communi m.logger.Debug("failed to retrieve community by id string", zap.Error(err)) } - if c.IsAdmin() { + if c.IsOwner() { err := m.dispatchMagnetlinkMessage(sub.HistoryArchivesSeedingSignal.CommunityID) if err != nil { m.logger.Debug("failed to dispatch magnetlink message", zap.Error(err)) @@ -200,6 +225,13 @@ func (m *Messenger) handleCommunitiesSubscription(c chan *communities.Subscripti } } + if sub.CommunityAdminEvent != nil { + err := m.publishCommunityAdminEvent(sub.CommunityAdminEvent) + if err != nil { + m.logger.Warn("failed to publish community admin event", zap.Error(err)) + } + } + for _, invitation := range sub.Invitations { err := m.publishOrgInvitation(sub.Community, invitation) if err != nil { @@ -392,7 +424,7 @@ func (m *Messenger) initCommunityChats(community *communities.Community) ([]*Cha return nil, err } - if community.IsAdmin() { + if community.IsOwner() { // Init the community filter so we can receive messages on the community communityFilters, err := m.transport.InitCommunityFilters([]*ecdsa.PrivateKey{community.PrivateKey()}) if err != nil { @@ -677,11 +709,21 @@ func (m *Messenger) RequestToJoinCommunity(request *requests.RequestToJoinCommun SkipEncryption: true, MessageType: protobuf.ApplicationMetadataMessage_COMMUNITY_REQUEST_TO_JOIN, } + _, err = m.sender.SendCommunityMessage(context.Background(), rawMessage) if err != nil { return nil, err } + // send request to join also to community admins + communityAdmins := community.GetMemberAdmins() + for _, communityAdmin := range communityAdmins { + _, err := m.sender.SendPrivate(context.Background(), communityAdmin, &rawMessage) + if err != nil { + return nil, err + } + } + response := &MessengerResponse{RequestsToJoinCommunity: []*communities.RequestToJoin{requestToJoin}} response.AddCommunity(community) @@ -1634,6 +1676,10 @@ func (m *Messenger) CanceledRequestsToJoinForCommunity(id types.HexBytes) ([]*co return m.communitiesManager.CanceledRequestsToJoinForCommunity(id) } +func (m *Messenger) AcceptedRequestsToJoinForCommunity(id types.HexBytes) ([]*communities.RequestToJoin, error) { + return m.communitiesManager.AcceptedRequestsToJoinForCommunity(id) +} + func (m *Messenger) RemoveUserFromCommunity(id types.HexBytes, pkString string) (*MessengerResponse, error) { publicKey, err := common.HexToPubkey(pkString) if err != nil { @@ -1995,6 +2041,10 @@ func (m *Messenger) handleCommunityDescription(state *ReceivedMessageState, sign return err } + return m.handleCommunityResponse(state, communityResponse) +} + +func (m *Messenger) handleCommunityResponse(state *ReceivedMessageState, communityResponse *communities.CommunityResponse) error { community := communityResponse.Community state.Response.AddCommunity(community) @@ -2068,6 +2118,16 @@ func (m *Messenger) handleCommunityDescription(state *ReceivedMessageState, sign return nil } +func (m *Messenger) handleCommunityAdminEvent(state *ReceivedMessageState, signer *ecdsa.PublicKey, description protobuf.CommunityAdminEvent, rawPayload []byte) error { + + communityResponse, err := m.communitiesManager.HandleCommunityAdminEvent(signer, &description, rawPayload) + if err != nil { + return err + } + + return m.handleCommunityResponse(state, communityResponse) +} + func (m *Messenger) handleSyncCommunity(messageState *ReceivedMessageState, syncCommunity protobuf.SyncCommunity) error { logger := m.logger.Named("handleSyncCommunity") diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index cc497df98..cd088b009 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -1455,6 +1455,9 @@ func (m *Messenger) HandleCommunityRequestToJoin(state *ReceivedMessageState, si } if requestToJoin.State == communities.RequestToJoinStatePending { + if state.Response.RequestsToJoinCommunity == nil { + state.Response.RequestsToJoinCommunity = make([]*communities.RequestToJoin, 0) + } state.Response.RequestsToJoinCommunity = append(state.Response.RequestsToJoinCommunity, requestToJoin) state.Response.AddNotification(NewCommunityRequestToJoinNotification(requestToJoin.ID.String(), community, contact)) @@ -2544,10 +2547,10 @@ func (m *Messenger) matchChatEntity(chatEntity common.ChatEntity) (*Chat, error) return nil, err } - isMemberAdmin := community.IsMemberAdmin(chatEntity.GetSigPubKey()) + isMemberOwnerOrAdmin := community.IsMemberOwnerOrAdmin(chatEntity.GetSigPubKey()) pinMessageAllowed := community.AllowsAllMembersToPinMessage() - if (pinMessage && !isMemberAdmin && !pinMessageAllowed) || (!emojiReaction && !canPost) { + if (pinMessage && !isMemberOwnerOrAdmin && !pinMessageAllowed) || (!emojiReaction && !canPost) { return nil, errors.New("user can't post") } diff --git a/protocol/messenger_pin_messages.go b/protocol/messenger_pin_messages.go index 71fff1a9b..acf3d9d1f 100644 --- a/protocol/messenger_pin_messages.go +++ b/protocol/messenger_pin_messages.go @@ -36,10 +36,10 @@ func (m *Messenger) sendPinMessage(ctx context.Context, message *common.PinMessa if err != nil { return nil, err } - isMemberAdmin := community.IsMemberAdmin(&m.identity.PublicKey) + isMemberOwnerOrAdmin := community.IsMemberOwnerOrAdmin(&m.identity.PublicKey) pinMessageAllowed := community.AllowsAllMembersToPinMessage() - if !pinMessageAllowed && !isMemberAdmin { + if !pinMessageAllowed && !isMemberOwnerOrAdmin { return nil, errors.New("member can't pin message") } } diff --git a/protocol/messenger_response.go b/protocol/messenger_response.go index ecf4b2198..9d3814a38 100644 --- a/protocol/messenger_response.go +++ b/protocol/messenger_response.go @@ -294,7 +294,6 @@ func (r *MessengerResponse) IsEmpty() bool { // the existing Messages & Chats if they have the same ID func (r *MessengerResponse) Merge(response *MessengerResponse) error { if len(response.Invitations)+ - len(response.RequestsToJoinCommunity)+ len(response.Mailservers)+ len(response.clearedHistories)+ len(response.DiscordChannels)+ @@ -319,6 +318,7 @@ func (r *MessengerResponse) Merge(response *MessengerResponse) error { r.AddSavedAddresses(response.SavedAddresses()) r.AddKeycardActions(response.KeycardActions()) r.AddEnsUsernameDetails(response.EnsUsernameDetails()) + r.AddRequestsToJoinCommunity(response.RequestsToJoinCommunity) r.AddBookmarks(response.GetBookmarks()) r.CommunityChanges = append(r.CommunityChanges, response.CommunityChanges...) r.BackupHandled = response.BackupHandled @@ -352,6 +352,10 @@ func (r *MessengerResponse) AddCommunitySettings(c *communities.CommunitySetting r.communitiesSettings[c.CommunityID] = c } +func (r *MessengerResponse) AddRequestsToJoinCommunity(requestsToJoin []*communities.RequestToJoin) { + r.RequestsToJoinCommunity = append(r.RequestsToJoinCommunity, requestsToJoin...) +} + func (r *MessengerResponse) AddRequestToJoinCommunity(requestToJoin *communities.RequestToJoin) { r.RequestsToJoinCommunity = append(r.RequestsToJoinCommunity, requestToJoin) } diff --git a/protocol/migrations/migrations.go b/protocol/migrations/migrations.go index 8665e0a29..22e5a7644 100644 --- a/protocol/migrations/migrations.go +++ b/protocol/migrations/migrations.go @@ -177,7 +177,7 @@ func _000001_initDownDbSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "000001_init.down.db.sql", size: 65, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "000001_init.down.db.sql", size: 65, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5e, 0xbb, 0x3f, 0x1, 0x75, 0x19, 0x70, 0x86, 0xa7, 0x34, 0x40, 0x17, 0x34, 0x3e, 0x18, 0x51, 0x79, 0xd4, 0x22, 0xad, 0x8f, 0x80, 0xcc, 0xa6, 0xcc, 0x6, 0x2b, 0x62, 0x2, 0x47, 0xba, 0xf9}} return a, nil } @@ -197,7 +197,7 @@ func _000001_initUpDbSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "000001_init.up.db.sql", size: 2719, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "000001_init.up.db.sql", size: 2719, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x60, 0xdc, 0xeb, 0xe, 0xc2, 0x4f, 0x75, 0xa, 0xf6, 0x3e, 0xc7, 0xc4, 0x4, 0xe2, 0xe1, 0xa4, 0x73, 0x2f, 0x4a, 0xad, 0x1a, 0x0, 0xc3, 0x93, 0x9d, 0x77, 0x3e, 0x31, 0x91, 0x77, 0x2e, 0xc8}} return a, nil } @@ -217,7 +217,7 @@ func _000002_add_last_ens_clock_valueUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "000002_add_last_ens_clock_value.up.sql", size: 77, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "000002_add_last_ens_clock_value.up.sql", size: 77, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4d, 0x3, 0x8f, 0xd5, 0x85, 0x83, 0x47, 0xbe, 0xf9, 0x82, 0x7e, 0x81, 0xa4, 0xbd, 0xaa, 0xd5, 0x98, 0x18, 0x5, 0x2d, 0x82, 0x42, 0x3b, 0x3, 0x50, 0xc3, 0x1e, 0x84, 0x35, 0xf, 0xb6, 0x2b}} return a, nil } @@ -237,7 +237,7 @@ func _1586358095_add_replaceUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1586358095_add_replace.up.sql", size: 224, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1586358095_add_replace.up.sql", size: 224, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0xb3, 0xa9, 0xc7, 0x7f, 0x9d, 0x8f, 0x43, 0x8c, 0x9e, 0x58, 0x8d, 0x44, 0xbc, 0xfa, 0x6b, 0x5f, 0x3f, 0x5a, 0xbe, 0xe8, 0xb1, 0x16, 0xf, 0x91, 0x2a, 0xa0, 0x71, 0xbb, 0x8d, 0x6b, 0xcb}} return a, nil } @@ -257,7 +257,7 @@ func _1588665364_add_image_dataUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1588665364_add_image_data.up.sql", size: 186, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1588665364_add_image_data.up.sql", size: 186, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd6, 0xc6, 0x35, 0xb4, 0x4c, 0x39, 0x96, 0x29, 0x30, 0xda, 0xf4, 0x8f, 0xcb, 0xf1, 0x9f, 0x84, 0xdc, 0x88, 0xd4, 0xd5, 0xbc, 0xb6, 0x5b, 0x46, 0x78, 0x67, 0x76, 0x1a, 0x5, 0x36, 0xdc, 0xe5}} return a, nil } @@ -277,7 +277,7 @@ func _1589365189_add_pow_targetUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1589365189_add_pow_target.up.sql", size: 66, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1589365189_add_pow_target.up.sql", size: 66, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4e, 0x3a, 0xe2, 0x2e, 0x7d, 0xaf, 0xbb, 0xcc, 0x21, 0xa1, 0x7a, 0x41, 0x9a, 0xd0, 0xbb, 0xa9, 0xc8, 0x35, 0xf9, 0x32, 0x34, 0x46, 0x44, 0x9a, 0x86, 0x40, 0x7c, 0xb9, 0x23, 0xc7, 0x3, 0x3f}} return a, nil } @@ -297,7 +297,7 @@ func _1591277220_add_index_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1591277220_add_index_messages.up.sql", size: 240, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1591277220_add_index_messages.up.sql", size: 240, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9c, 0xfe, 0xbe, 0xd5, 0xb8, 0x8f, 0xdd, 0xef, 0xbb, 0xa8, 0xad, 0x7f, 0xed, 0x5b, 0x5b, 0x2f, 0xe6, 0x82, 0x27, 0x78, 0x1f, 0xb9, 0x57, 0xdc, 0x8, 0xc2, 0xb2, 0xa9, 0x9a, 0x4, 0xe1, 0x7a}} return a, nil } @@ -317,7 +317,7 @@ func _1593087212_add_mute_chat_and_raw_message_fieldsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1593087212_add_mute_chat_and_raw_message_fields.up.sql", size: 215, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1593087212_add_mute_chat_and_raw_message_fields.up.sql", size: 215, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x73, 0x99, 0x61, 0xd1, 0xaa, 0xb4, 0xbf, 0xaf, 0xd7, 0x20, 0x17, 0x40, 0xf9, 0x2, 0xfb, 0xcc, 0x40, 0x2a, 0xd, 0x86, 0x36, 0x30, 0x88, 0x89, 0x25, 0x80, 0x42, 0xb0, 0x5b, 0xe9, 0x73, 0x78}} return a, nil } @@ -337,7 +337,7 @@ func _1595862781_add_audio_dataUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1595862781_add_audio_data.up.sql", size: 246, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1595862781_add_audio_data.up.sql", size: 246, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xae, 0xd2, 0xee, 0x55, 0xfb, 0x36, 0xa4, 0x92, 0x66, 0xe, 0x81, 0x62, 0x1e, 0x7a, 0x69, 0xa, 0xd5, 0x4b, 0xa5, 0x6a, 0x8d, 0x1d, 0xce, 0xf3, 0x3e, 0xc0, 0x5f, 0x9c, 0x66, 0x1b, 0xb4, 0xed}} return a, nil } @@ -357,7 +357,7 @@ func _1595865249_create_emoji_reactions_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1595865249_create_emoji_reactions_table.up.sql", size: 300, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1595865249_create_emoji_reactions_table.up.sql", size: 300, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xc5, 0x43, 0x5c, 0x3d, 0x53, 0x43, 0x2c, 0x1a, 0xa5, 0xb6, 0xbf, 0x7, 0x4, 0x5a, 0x3e, 0x40, 0x8b, 0xa4, 0x57, 0x12, 0x58, 0xbc, 0x42, 0xe2, 0xc3, 0xde, 0x76, 0x98, 0x80, 0xe2, 0xbe}} return a, nil } @@ -377,7 +377,7 @@ func _1596805115_create_group_chat_invitations_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1596805115_create_group_chat_invitations_table.up.sql", size: 231, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1596805115_create_group_chat_invitations_table.up.sql", size: 231, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6d, 0xb1, 0x14, 0x6d, 0x54, 0x28, 0x67, 0xc3, 0x23, 0x6a, 0xfc, 0x80, 0xdf, 0x9e, 0x4c, 0x35, 0x36, 0xf, 0xf8, 0xf3, 0x5f, 0xae, 0xad, 0xb, 0xc1, 0x51, 0x8e, 0x17, 0x7, 0xe5, 0x7f, 0x91}} return a, nil } @@ -397,7 +397,7 @@ func _1597322655_add_invitation_admin_chat_fieldUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1597322655_add_invitation_admin_chat_field.up.sql", size: 54, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1597322655_add_invitation_admin_chat_field.up.sql", size: 54, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0x7a, 0xa0, 0xf2, 0xdb, 0x13, 0x91, 0x91, 0xa8, 0x34, 0x1a, 0xa1, 0x49, 0x68, 0xd5, 0xae, 0x2c, 0xd8, 0xd5, 0xea, 0x8f, 0x8c, 0xc7, 0x2, 0x4e, 0x58, 0x2c, 0x3a, 0x14, 0xd4, 0x4f, 0x2c}} return a, nil } @@ -417,7 +417,7 @@ func _1597757544_add_nicknameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1597757544_add_nickname.up.sql", size: 52, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1597757544_add_nickname.up.sql", size: 52, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xa2, 0x64, 0x50, 0xc5, 0x4, 0xb9, 0x8b, 0xd1, 0x18, 0x9b, 0xc3, 0x91, 0x36, 0x2a, 0x1f, 0xc3, 0x6c, 0x2d, 0x92, 0xf8, 0x5e, 0xff, 0xb1, 0x59, 0x61, 0x2, 0x1c, 0xe1, 0x85, 0x90, 0xa4}} return a, nil } @@ -437,7 +437,7 @@ func _1598955122_add_mentionsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1598955122_add_mentions.up.sql", size: 52, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1598955122_add_mentions.up.sql", size: 52, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8d, 0x22, 0x17, 0x92, 0xd2, 0x11, 0x4e, 0x7, 0x93, 0x9a, 0x55, 0xfd, 0xb, 0x97, 0xc4, 0x63, 0x6a, 0x81, 0x97, 0xcd, 0xb2, 0xf8, 0x4b, 0x5f, 0x3c, 0xfa, 0x3a, 0x38, 0x53, 0x10, 0xed, 0x9d}} return a, nil } @@ -457,7 +457,7 @@ func _1599641390_add_emoji_reactions_indexUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1599641390_add_emoji_reactions_index.up.sql", size: 126, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1599641390_add_emoji_reactions_index.up.sql", size: 126, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf9, 0xd8, 0xdc, 0xa7, 0xb, 0x92, 0x7a, 0x61, 0x37, 0x24, 0x1c, 0x77, 0x5e, 0xe, 0x7e, 0xfc, 0x9f, 0x98, 0x7b, 0x65, 0xe7, 0xf9, 0x71, 0x57, 0x89, 0x2d, 0x90, 0x1b, 0xf6, 0x5e, 0x37, 0xe8}} return a, nil } @@ -477,7 +477,7 @@ func _1599720851_add_seen_index_remove_long_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1599720851_add_seen_index_remove_long_messages.up.sql", size: 150, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1599720851_add_seen_index_remove_long_messages.up.sql", size: 150, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x24, 0x1c, 0xc4, 0x78, 0x91, 0xc7, 0xeb, 0xfe, 0xc8, 0xa0, 0xd8, 0x13, 0x27, 0x97, 0xc8, 0x96, 0x56, 0x97, 0x33, 0x2c, 0x1e, 0x16, 0x8a, 0xd3, 0x49, 0x99, 0x3, 0xe9, 0xbb, 0xc4, 0x5, 0x3c}} return a, nil } @@ -497,7 +497,7 @@ func _1603198582_add_profile_chat_fieldUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1603198582_add_profile_chat_field.up.sql", size: 45, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1603198582_add_profile_chat_field.up.sql", size: 45, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xaa, 0xca, 0xe, 0x46, 0xa0, 0x9, 0x9d, 0x47, 0x57, 0xe9, 0xfb, 0x17, 0xeb, 0x9c, 0xf6, 0xb8, 0x1d, 0xe9, 0xd, 0x0, 0xd5, 0xe5, 0xd8, 0x9e, 0x60, 0xa, 0xbf, 0x32, 0x2c, 0x52, 0x7f, 0x6a}} return a, nil } @@ -517,7 +517,7 @@ func _1603816533_add_linksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1603816533_add_links.up.sql", size: 48, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1603816533_add_links.up.sql", size: 48, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0x24, 0xd6, 0x1d, 0xa, 0x83, 0x1e, 0x4d, 0xf, 0xae, 0x4d, 0x8c, 0x51, 0x32, 0xa8, 0x37, 0xb0, 0x14, 0xfb, 0x32, 0x34, 0xc8, 0xc, 0x4e, 0x5b, 0xc5, 0x15, 0x65, 0x73, 0x0, 0x0, 0x1d}} return a, nil } @@ -537,7 +537,7 @@ func _1603888149_create_chat_identity_last_published_tableUpSql() (*asset, error return nil, err } - info := bindataFileInfo{name: "1603888149_create_chat_identity_last_published_table.up.sql", size: 407, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1603888149_create_chat_identity_last_published_table.up.sql", size: 407, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7f, 0x9, 0xf, 0xfb, 0xdb, 0x3c, 0x86, 0x70, 0x82, 0xda, 0x10, 0x25, 0xe2, 0x4e, 0x40, 0x45, 0xab, 0x8b, 0x1c, 0x91, 0x7c, 0xf1, 0x70, 0x2e, 0x81, 0xf3, 0x71, 0x45, 0xda, 0xe2, 0xa4, 0x57}} return a, nil } @@ -557,7 +557,7 @@ func _1605075346_add_communitiesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1605075346_add_communities.up.sql", size: 6971, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1605075346_add_communities.up.sql", size: 6971, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1f, 0x64, 0xea, 0xb4, 0xae, 0x9e, 0xdb, 0x9, 0x58, 0xb6, 0x5c, 0x7a, 0x50, 0xc5, 0xfe, 0x93, 0x5d, 0x36, 0x85, 0x5d, 0x6a, 0xba, 0xc9, 0x7e, 0x84, 0xd7, 0xbf, 0x2a, 0x53, 0xf3, 0x97, 0xf1}} return a, nil } @@ -577,7 +577,7 @@ func _1610117927_add_message_cacheUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1610117927_add_message_cache.up.sql", size: 142, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1610117927_add_message_cache.up.sql", size: 142, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x34, 0xf1, 0xf0, 0x82, 0x79, 0x28, 0x19, 0xc2, 0x39, 0x6a, 0xa5, 0x96, 0x59, 0x23, 0xa0, 0xed, 0x60, 0x58, 0x86, 0x9, 0xb9, 0xad, 0xfb, 0xa, 0xe3, 0x47, 0x6e, 0xa1, 0x18, 0xe8, 0x39, 0x2c}} return a, nil } @@ -597,7 +597,7 @@ func _1610959908_add_dont_wrap_to_raw_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1610959908_add_dont_wrap_to_raw_messages.up.sql", size: 83, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1610959908_add_dont_wrap_to_raw_messages.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0x2, 0x9a, 0xca, 0xd4, 0x38, 0x44, 0x30, 0x2b, 0xa8, 0x27, 0x32, 0x63, 0x53, 0x22, 0x60, 0x59, 0x84, 0x23, 0x96, 0x77, 0xf0, 0x56, 0xd7, 0x94, 0xe0, 0x95, 0x28, 0x6, 0x1d, 0x4e, 0xb1}} return a, nil } @@ -617,7 +617,7 @@ func _1610960912_add_send_on_personal_topicUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1610960912_add_send_on_personal_topic.up.sql", size: 82, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1610960912_add_send_on_personal_topic.up.sql", size: 82, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0xac, 0x2f, 0xc4, 0xd, 0xa7, 0x1b, 0x37, 0x30, 0xc2, 0x68, 0xee, 0xde, 0x54, 0x5e, 0xbf, 0x3f, 0xa0, 0xd6, 0xc6, 0x9f, 0xd4, 0x34, 0x12, 0x76, 0x1e, 0x66, 0x4a, 0xfc, 0xf, 0xee, 0xc9}} return a, nil } @@ -637,7 +637,7 @@ func _1612870480_add_datasync_idUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1612870480_add_datasync_id.up.sql", size: 111, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1612870480_add_datasync_id.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x34, 0x9a, 0xbc, 0xfa, 0xaa, 0x8c, 0x9c, 0x37, 0x67, 0x15, 0x9c, 0x7e, 0x78, 0x75, 0x66, 0x82, 0x18, 0x72, 0x10, 0xbc, 0xd4, 0xab, 0x44, 0xfe, 0x57, 0x85, 0x6d, 0x19, 0xf5, 0x96, 0x8a, 0xbe}} return a, nil } @@ -657,7 +657,7 @@ func _1614152139_add_communities_request_to_joinUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1614152139_add_communities_request_to_join.up.sql", size: 831, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1614152139_add_communities_request_to_join.up.sql", size: 831, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x11, 0x3, 0x26, 0xf9, 0x29, 0x50, 0x4f, 0xcd, 0x46, 0xe5, 0xb1, 0x6b, 0xb9, 0x2, 0x40, 0xb1, 0xdf, 0x4a, 0x4c, 0x7a, 0xda, 0x3, 0x35, 0xcd, 0x2d, 0xcc, 0x80, 0x7d, 0x57, 0x5f, 0x3, 0x5c}} return a, nil } @@ -677,7 +677,7 @@ func _1615374373_add_confirmationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1615374373_add_confirmations.up.sql", size: 227, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1615374373_add_confirmations.up.sql", size: 227, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdd, 0xa6, 0x65, 0xc5, 0x1d, 0xb2, 0x77, 0x36, 0xe3, 0x79, 0xda, 0xe8, 0x7a, 0xa4, 0xdf, 0x45, 0xae, 0xd8, 0xb4, 0xba, 0x90, 0xfd, 0x74, 0x71, 0x14, 0x75, 0x73, 0x72, 0xb9, 0x9e, 0x1, 0x81}} return a, nil } @@ -697,7 +697,7 @@ func _1617694931_add_notification_centerUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1617694931_add_notification_center.up.sql", size: 572, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1617694931_add_notification_center.up.sql", size: 572, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0x45, 0xc6, 0xc9, 0x73, 0xbb, 0x1f, 0xda, 0xa3, 0x4d, 0x19, 0x98, 0x85, 0x2d, 0xca, 0xda, 0xcc, 0x3b, 0x32, 0xff, 0xc7, 0x7b, 0xe3, 0x9f, 0x9b, 0x2a, 0x93, 0xf5, 0xdf, 0x65, 0x38, 0x91}} return a, nil } @@ -717,7 +717,7 @@ func _1618923660_create_pin_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1618923660_create_pin_messages.up.sql", size: 265, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1618923660_create_pin_messages.up.sql", size: 265, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x61, 0x44, 0x3a, 0xbe, 0x30, 0xd2, 0x7e, 0xc0, 0xe2, 0x8e, 0x65, 0x53, 0x54, 0xbb, 0x7a, 0x1c, 0xb3, 0x5d, 0xd2, 0xa6, 0xa9, 0x28, 0xb7, 0xa4, 0x5f, 0x8b, 0x9, 0x5f, 0x17, 0xc1, 0x85, 0x21}} return a, nil } @@ -737,7 +737,7 @@ func _1619094007_add_joined_chat_fieldUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1619094007_add_joined_chat_field.up.sql", size: 101, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1619094007_add_joined_chat_field.up.sql", size: 101, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfa, 0x30, 0x81, 0x3a, 0x2f, 0x9f, 0xb3, 0x0, 0x55, 0x8e, 0x1d, 0xa8, 0xb0, 0x68, 0xf0, 0x40, 0x1a, 0x6c, 0xaa, 0xfc, 0x33, 0xd1, 0xd1, 0x55, 0x3f, 0xf2, 0xbd, 0x54, 0xa1, 0x2b, 0x40, 0x95}} return a, nil } @@ -757,7 +757,7 @@ func _1619099821_add_last_synced_fieldUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1619099821_add_last_synced_field.up.sql", size: 226, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1619099821_add_last_synced_field.up.sql", size: 226, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf, 0x52, 0x22, 0xe, 0x2f, 0xd7, 0x93, 0x5f, 0x42, 0xc2, 0x93, 0x4, 0x35, 0x6f, 0xc9, 0x19, 0xed, 0x6b, 0x52, 0x6f, 0xae, 0x99, 0xe2, 0x68, 0x3d, 0x4f, 0x40, 0xe, 0xe1, 0xa, 0x47, 0x21}} return a, nil } @@ -777,7 +777,7 @@ func _1621933219_add_mentionedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1621933219_add_mentioned.up.sql", size: 70, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1621933219_add_mentioned.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x36, 0x76, 0x8a, 0xc9, 0x7, 0x8f, 0xa5, 0xcb, 0x12, 0x21, 0x4e, 0xfe, 0x96, 0x77, 0xcf, 0x7f, 0x76, 0x75, 0x36, 0x2c, 0xf8, 0x1d, 0x13, 0xcb, 0xcd, 0x6e, 0x70, 0xbf, 0xf5, 0x93, 0x67, 0xd1}} return a, nil } @@ -797,7 +797,7 @@ func _1622010048_add_unviewed_mentions_countUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1622010048_add_unviewed_mentions_count.up.sql", size: 114, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1622010048_add_unviewed_mentions_count.up.sql", size: 114, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7c, 0x16, 0x85, 0xa6, 0x5b, 0xe1, 0x66, 0xb9, 0x84, 0xbe, 0x7f, 0xa, 0x77, 0x23, 0xb9, 0xef, 0x8e, 0x2, 0x8, 0xfc, 0x61, 0xb2, 0x43, 0xa9, 0x63, 0xae, 0xb4, 0xdf, 0x30, 0xb1, 0x61, 0x4b}} return a, nil } @@ -817,7 +817,7 @@ func _1622061278_add_message_activity_center_notification_fieldUpSql() (*asset, return nil, err } - info := bindataFileInfo{name: "1622061278_add_message_activity_center_notification_field.up.sql", size: 80, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1622061278_add_message_activity_center_notification_field.up.sql", size: 80, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8, 0xc, 0xa6, 0x1f, 0xa5, 0xc6, 0x7c, 0x6f, 0xab, 0x2c, 0x2d, 0xb5, 0xa4, 0xdd, 0xc1, 0xd6, 0x44, 0x83, 0xf9, 0xb1, 0xa5, 0xce, 0x34, 0x3d, 0x2, 0xa9, 0x35, 0xcf, 0xc6, 0xb2, 0x43, 0x37}} return a, nil } @@ -837,7 +837,7 @@ func _1622464518_set_synced_to_fromUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1622464518_set_synced_to_from.up.sql", size: 105, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1622464518_set_synced_to_from.up.sql", size: 105, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x33, 0x3e, 0x2b, 0xa, 0x1e, 0xc7, 0x6d, 0x6f, 0xd1, 0x1d, 0xe8, 0x4b, 0xdd, 0x92, 0x76, 0xea, 0xf2, 0x3e, 0x15, 0x85, 0xc4, 0xc3, 0x31, 0xf1, 0xc0, 0xa2, 0xd7, 0x47, 0xde, 0x4e, 0xfd, 0xc6}} return a, nil } @@ -857,7 +857,7 @@ func _1622464519_add_chat_descriptionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1622464519_add_chat_description.up.sql", size: 93, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1622464519_add_chat_description.up.sql", size: 93, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x36, 0x2e, 0x89, 0x31, 0xec, 0xef, 0xeb, 0x43, 0xf5, 0x96, 0x6d, 0xce, 0x91, 0x8a, 0x37, 0x2a, 0x11, 0x7a, 0x3f, 0xd9, 0x10, 0xbb, 0xa1, 0xbc, 0x7, 0xe0, 0x3b, 0xa5, 0xf4, 0xa6, 0xf4, 0xa1}} return a, nil } @@ -877,7 +877,7 @@ func _1622622253_add_pinned_by_to_pin_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1622622253_add_pinned_by_to_pin_messages.up.sql", size: 52, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1622622253_add_pinned_by_to_pin_messages.up.sql", size: 52, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9b, 0x94, 0xa3, 0x45, 0x91, 0x1e, 0x66, 0xd1, 0x96, 0x5a, 0xaf, 0xfa, 0x29, 0x39, 0xa8, 0x3a, 0x97, 0x4c, 0x65, 0x6, 0x96, 0x90, 0x4c, 0xfe, 0xce, 0x7d, 0x5d, 0xd4, 0xb3, 0x8, 0x6d, 0x5f}} return a, nil } @@ -897,7 +897,7 @@ func _1623938329_add_author_activity_center_notification_fieldUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1623938329_add_author_activity_center_notification_field.up.sql", size: 66, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1623938329_add_author_activity_center_notification_field.up.sql", size: 66, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x36, 0xe6, 0xa7, 0xd5, 0x26, 0xff, 0xab, 0x92, 0x88, 0xf0, 0xd3, 0x34, 0xd9, 0x2f, 0xe7, 0x18, 0x1a, 0x40, 0xf9, 0xbe, 0x8e, 0xfc, 0xd0, 0x4f, 0x1f, 0x4a, 0xb9, 0x83, 0x3f, 0xa9, 0xde, 0xb}} return a, nil } @@ -917,7 +917,7 @@ func _1623938330_add_edit_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1623938330_add_edit_messages.up.sql", size: 369, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1623938330_add_edit_messages.up.sql", size: 369, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xd2, 0xce, 0xe, 0x5c, 0x19, 0xbe, 0x5e, 0x29, 0xbe, 0x9b, 0x31, 0x53, 0x76, 0xb2, 0xc8, 0x56, 0xf0, 0x82, 0xfe, 0x7d, 0x6c, 0xe8, 0x5c, 0xe9, 0x7a, 0x5d, 0x5, 0xc4, 0x92, 0x38, 0xe3}} return a, nil } @@ -937,7 +937,7 @@ func _1624978434_add_muted_communityUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1624978434_add_muted_community.up.sql", size: 82, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1624978434_add_muted_community.up.sql", size: 82, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6, 0xdc, 0x6e, 0x6f, 0x97, 0xc7, 0x3d, 0x50, 0xab, 0x80, 0x87, 0x44, 0x43, 0x38, 0xe6, 0xc5, 0xc1, 0x91, 0x26, 0xf, 0x16, 0xe, 0xd9, 0x32, 0x37, 0x25, 0x96, 0x25, 0x6, 0xc8, 0xb5, 0x4a}} return a, nil } @@ -957,7 +957,7 @@ func _1625018910_add_repply_message_activity_center_notification_fieldUpSql() (* return nil, err } - info := bindataFileInfo{name: "1625018910_add_repply_message_activity_center_notification_field.up.sql", size: 86, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1625018910_add_repply_message_activity_center_notification_field.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf2, 0x52, 0x12, 0x40, 0xd8, 0x6f, 0x71, 0x97, 0x46, 0x39, 0xaa, 0x74, 0x41, 0xcd, 0x45, 0x4c, 0xe8, 0xd9, 0xe2, 0x56, 0x8e, 0x78, 0x18, 0x62, 0xf6, 0xa8, 0x36, 0xe9, 0x9a, 0x1f, 0xc, 0xb1}} return a, nil } @@ -977,7 +977,7 @@ func _1625762506_add_deleted_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1625762506_add_deleted_messages.up.sql", size: 357, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1625762506_add_deleted_messages.up.sql", size: 357, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0x61, 0x42, 0xb6, 0x8c, 0x7f, 0x2d, 0xec, 0xa9, 0x6d, 0x3d, 0x0, 0xa3, 0x32, 0xd8, 0x4a, 0x38, 0x5c, 0x97, 0xfc, 0x68, 0xde, 0xa9, 0xb7, 0xd8, 0xde, 0xb, 0x29, 0x93, 0xdc, 0x81, 0xf8}} return a, nil } @@ -997,7 +997,7 @@ func _1627388946_add_communities_synced_atUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1627388946_add_communities_synced_at.up.sql", size: 87, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1627388946_add_communities_synced_at.up.sql", size: 87, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc1, 0xbd, 0x9b, 0x6a, 0xc9, 0x1a, 0x7a, 0x34, 0xcf, 0x5f, 0x80, 0x9e, 0x8c, 0x1c, 0xc0, 0xec, 0x4e, 0x78, 0xb0, 0x2d, 0x15, 0x77, 0x38, 0x4a, 0x6a, 0x5, 0x84, 0xf5, 0x8d, 0x8b, 0xbe, 0x9}} return a, nil } @@ -1017,7 +1017,7 @@ func _1628280060_createUsermessagesIndexSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1628280060_create-usermessages-index.sql", size: 80, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1628280060_create-usermessages-index.sql", size: 80, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0x6f, 0x70, 0x47, 0x40, 0xab, 0xa8, 0x60, 0xe0, 0xf9, 0x8, 0x7e, 0x19, 0x9d, 0xba, 0x33, 0x16, 0xfc, 0x3c, 0xdc, 0xa8, 0xa6, 0x53, 0x61, 0x39, 0x82, 0x91, 0xcf, 0x69, 0xd8, 0xf2, 0xcf}} return a, nil } @@ -1037,7 +1037,7 @@ func _1632303896_modify_contacts_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1632303896_modify_contacts_table.up.sql", size: 1574, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1632303896_modify_contacts_table.up.sql", size: 1574, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x1e, 0x6c, 0x3c, 0xd, 0xd7, 0x7d, 0xbb, 0x19, 0xbc, 0xe4, 0x7, 0xfd, 0xf8, 0x66, 0x6d, 0x78, 0xf6, 0x4, 0xe6, 0x51, 0xe4, 0xe6, 0xdc, 0xe, 0x5a, 0x2e, 0xac, 0xe6, 0xe7, 0x24, 0x69}} return a, nil } @@ -1057,7 +1057,7 @@ func _1633349838_add_emoji_column_in_chatsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1633349838_add_emoji_column_in_chats.up.sql", size: 52, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1633349838_add_emoji_column_in_chats.up.sql", size: 52, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xcb, 0x33, 0xcb, 0x3b, 0xa9, 0x99, 0x77, 0x6a, 0xea, 0xc4, 0x39, 0xd7, 0xa1, 0x49, 0xa7, 0xdf, 0xff, 0x72, 0xda, 0x34, 0x21, 0x67, 0x66, 0xca, 0x65, 0x46, 0x1, 0xa6, 0x4e, 0xf9, 0x38, 0x86}} return a, nil } @@ -1077,7 +1077,7 @@ func _1634831235_add_highlight_column_in_chatsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1634831235_add_highlight_column_in_chats.up.sql", size: 62, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1634831235_add_highlight_column_in_chats.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xaa, 0x63, 0x5c, 0x73, 0x19, 0x83, 0xbd, 0x35, 0x80, 0x9f, 0x66, 0xec, 0x4c, 0xbc, 0x9d, 0x2d, 0x52, 0x91, 0x6d, 0xb3, 0x2b, 0x87, 0xde, 0x24, 0x46, 0x5c, 0xd, 0xfd, 0x78, 0xf5, 0xe3, 0xe9}} return a, nil } @@ -1097,7 +1097,7 @@ func _1634896007_add_last_updated_locally_and_removedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1634896007_add_last_updated_locally_and_removed.up.sql", size: 131, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1634896007_add_last_updated_locally_and_removed.up.sql", size: 131, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2e, 0xa8, 0x34, 0xe2, 0xc0, 0x62, 0xc8, 0xd6, 0x5a, 0x87, 0xe3, 0x70, 0xe1, 0xc4, 0x16, 0x9c, 0x60, 0x2e, 0x98, 0xf0, 0x91, 0x84, 0xbe, 0xe0, 0xdf, 0x3e, 0x4d, 0x24, 0xc4, 0x6c, 0x40, 0x17}} return a, nil } @@ -1117,7 +1117,7 @@ func _1635840039_add_clock_read_at_column_in_chatsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1635840039_add_clock_read_at_column_in_chats.up.sql", size: 245, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1635840039_add_clock_read_at_column_in_chats.up.sql", size: 245, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6c, 0xba, 0x3f, 0xba, 0x1a, 0x71, 0xa8, 0x9, 0x19, 0xbe, 0x1e, 0x38, 0x50, 0x30, 0x3a, 0x52, 0x15, 0x29, 0xee, 0x49, 0x19, 0x6f, 0x53, 0xc2, 0xc6, 0x6c, 0xd9, 0x80, 0x7e, 0xb9, 0x58, 0x7a}} return a, nil } @@ -1137,7 +1137,7 @@ func _1637852321_add_received_invitation_admin_column_in_chatsUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1637852321_add_received_invitation_admin_column_in_chats.up.sql", size: 72, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1637852321_add_received_invitation_admin_column_in_chats.up.sql", size: 72, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x70, 0x8b, 0x92, 0x56, 0x83, 0x70, 0x7f, 0x6, 0xb2, 0xd, 0x1c, 0x2f, 0xcc, 0x93, 0xc3, 0x85, 0x8c, 0xc2, 0x38, 0x94, 0x7e, 0x88, 0x3f, 0x39, 0x34, 0xf8, 0x90, 0xcf, 0x83, 0x68, 0x3d, 0xe5}} return a, nil } @@ -1157,7 +1157,7 @@ func _1645034601_display_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1645034601_display_name.up.sql", size: 110, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1645034601_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x15, 0xfc, 0xda, 0x70, 0x53, 0x19, 0x90, 0x20, 0x4, 0x1c, 0x99, 0x42, 0x53, 0x1a, 0xd6, 0xb8, 0xbb, 0x8a, 0xe8, 0xbe, 0xcc, 0xb7, 0xc, 0x7f, 0x73, 0x50, 0x18, 0xf1, 0x8b, 0x18, 0x54, 0x64}} return a, nil } @@ -1177,7 +1177,7 @@ func _1645034602_add_mutual_contact_requestUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1645034602_add_mutual_contact_request.up.sql", size: 454, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1645034602_add_mutual_contact_request.up.sql", size: 454, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xe0, 0x5d, 0x68, 0xb8, 0x50, 0xa4, 0xbb, 0x3e, 0x4f, 0x2, 0x87, 0xad, 0x87, 0x6e, 0x38, 0xdf, 0xc8, 0x4c, 0xe2, 0x5f, 0xd1, 0x6, 0xdc, 0xe7, 0xbd, 0x4a, 0x9c, 0xf3, 0x91, 0xa1, 0x51}} return a, nil } @@ -1197,7 +1197,7 @@ func _1650373957_add_contact_request_stateUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1650373957_add_contact_request_state.up.sql", size: 59, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1650373957_add_contact_request_state.up.sql", size: 59, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5e, 0xc1, 0x3f, 0x29, 0xe, 0x19, 0x86, 0x1a, 0x4c, 0x6c, 0x2a, 0x90, 0x9d, 0xdf, 0xb1, 0xb, 0x72, 0x25, 0xcd, 0x6c, 0x5f, 0xd, 0x51, 0x9e, 0x85, 0xc0, 0x9, 0xb7, 0xbc, 0x87, 0x23, 0xec}} return a, nil } @@ -1217,7 +1217,7 @@ func _1656958989_contact_verificationUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1656958989_contact_verification.up.sql", size: 624, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1656958989_contact_verification.up.sql", size: 624, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3a, 0x3f, 0x28, 0x38, 0x33, 0xdb, 0xe9, 0x4d, 0xc0, 0x54, 0x8c, 0x2a, 0x73, 0xc4, 0xdd, 0x5c, 0xc5, 0x1a, 0x93, 0x4b, 0x6, 0x13, 0xbe, 0x42, 0xd2, 0x7f, 0xd4, 0xc, 0xc5, 0x4e, 0x6d, 0xce}} return a, nil } @@ -1237,7 +1237,7 @@ func _1658236268_add_discord_message_authors_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1658236268_add_discord_message_authors_table.up.sql", size: 191, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1658236268_add_discord_message_authors_table.up.sql", size: 191, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3d, 0xb7, 0xdb, 0x79, 0x1, 0x15, 0xe7, 0x76, 0x5d, 0x22, 0x54, 0x82, 0x9a, 0xbe, 0x24, 0xc1, 0x82, 0xcf, 0x67, 0x91, 0x53, 0xcc, 0xac, 0x74, 0x18, 0x61, 0x69, 0x68, 0x19, 0xca, 0x2b, 0xa8}} return a, nil } @@ -1257,7 +1257,7 @@ func _1659619997_add_discord_messages_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1659619997_add_discord_messages_table.up.sql", size: 371, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1659619997_add_discord_messages_table.up.sql", size: 371, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x12, 0x9c, 0x96, 0xe2, 0x42, 0x3f, 0x94, 0x62, 0xc2, 0x76, 0xab, 0x3b, 0x4c, 0x85, 0x36, 0x48, 0xcc, 0x73, 0x60, 0x93, 0x5a, 0xd6, 0x7, 0xd6, 0x0, 0xee, 0x1b, 0x1e, 0x34, 0x58, 0x99}} return a, nil } @@ -1277,7 +1277,7 @@ func _1660226788_create_chat_identity_social_linksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660226788_create_chat_identity_social_links.up.sql", size: 318, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660226788_create_chat_identity_social_links.up.sql", size: 318, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3c, 0x76, 0x40, 0xe9, 0x85, 0xc4, 0x38, 0xf8, 0xe5, 0x5d, 0xe8, 0x13, 0x46, 0x1b, 0xc, 0x1, 0xe9, 0x2f, 0x74, 0xd1, 0x79, 0x59, 0xa4, 0xdb, 0x4a, 0x4a, 0xf4, 0x98, 0x58, 0x3c, 0x57, 0xd3}} return a, nil } @@ -1297,7 +1297,7 @@ func _1660226789_add_walletconnectsessions_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660226789_add_walletconnectsessions_table.up.sql", size: 215, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1660226789_add_walletconnectsessions_table.up.sql", size: 215, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf8, 0x5c, 0x72, 0x2, 0xed, 0x36, 0x19, 0x91, 0x4d, 0x1a, 0xc1, 0xab, 0x84, 0xfa, 0x41, 0xb1, 0x46, 0xa5, 0xdb, 0x3f, 0x76, 0x47, 0xd3, 0x75, 0x3c, 0x6a, 0x8e, 0x78, 0xe6, 0x41, 0xdc, 0x7f}} return a, nil } @@ -1317,7 +1317,7 @@ func _1661242854_add_communities_requests_to_leaveUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1661242854_add_communities_requests_to_leave.up.sql", size: 204, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1661242854_add_communities_requests_to_leave.up.sql", size: 204, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0x2e, 0x7d, 0x14, 0xef, 0x6e, 0x95, 0x4b, 0x6, 0x70, 0x2e, 0xd1, 0xf6, 0x59, 0xf9, 0xe, 0x56, 0xa, 0x9c, 0x80, 0x18, 0xca, 0xb9, 0x49, 0x19, 0xf, 0x89, 0x94, 0x36, 0x6d, 0x93, 0x9a}} return a, nil } @@ -1337,7 +1337,7 @@ func _1662044232_add_chat_imageUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662044232_add_chat_image.up.sql", size: 49, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662044232_add_chat_image.up.sql", size: 49, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb3, 0x74, 0xdf, 0x50, 0x79, 0x73, 0x9e, 0xd0, 0xff, 0xa4, 0xd3, 0x87, 0xc3, 0x48, 0x31, 0x6c, 0xdf, 0xa6, 0x20, 0x85, 0xe6, 0x4e, 0x19, 0x9d, 0xef, 0xcc, 0x84, 0x2b, 0x5d, 0x44, 0x34, 0x6}} return a, nil } @@ -1357,7 +1357,7 @@ func _1662106895_add_chat_first_message_timestampUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662106895_add_chat_first_message_timestamp.up.sql", size: 113, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662106895_add_chat_first_message_timestamp.up.sql", size: 113, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8b, 0x55, 0x74, 0xfa, 0xf5, 0x51, 0x85, 0x19, 0xfd, 0xfb, 0x6, 0x79, 0x4d, 0x1d, 0xd, 0x3, 0x46, 0x66, 0x34, 0x1e, 0xce, 0x91, 0x21, 0x29, 0xf6, 0x71, 0xe7, 0x31, 0x39, 0x8f, 0x9d, 0x5}} return a, nil } @@ -1377,7 +1377,7 @@ func _1662723928_add_discord_author_image_fieldsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662723928_add_discord_author_image_fields.up.sql", size: 75, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1662723928_add_discord_author_image_fields.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0x5b, 0x48, 0x57, 0x98, 0x55, 0x9a, 0xf1, 0x75, 0xf7, 0xb5, 0x41, 0x5e, 0x96, 0xc5, 0xce, 0xfc, 0x30, 0x5c, 0x15, 0x35, 0x9e, 0x4e, 0x4a, 0x3b, 0x38, 0x42, 0xc4, 0x27, 0x3c, 0x87, 0xbf}} return a, nil } @@ -1397,7 +1397,7 @@ func _1664195977_add_deleted_for_mesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664195977_add_deleted_for_mes.up.sql", size: 352, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1664195977_add_deleted_for_mes.up.sql", size: 352, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7d, 0x9d, 0x13, 0x9, 0xaa, 0x44, 0x14, 0x93, 0xe2, 0xf5, 0x53, 0xb7, 0x79, 0xa8, 0x18, 0xf0, 0x6c, 0xa4, 0x9c, 0x73, 0xc1, 0xaa, 0xc5, 0x2e, 0xc5, 0x41, 0xd7, 0x24, 0xb0, 0xd7, 0xb8, 0xdf}} return a, nil } @@ -1417,7 +1417,7 @@ func _1664367420_add_discord_attachments_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664367420_add_discord_attachments_table.up.sql", size: 350, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1664367420_add_discord_attachments_table.up.sql", size: 350, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0xe1, 0xb6, 0x4f, 0x6f, 0x92, 0x0, 0xb4, 0xf, 0x55, 0x12, 0x1c, 0x98, 0x6d, 0xbc, 0x1e, 0xfd, 0xae, 0x1c, 0xce, 0xd1, 0x3d, 0x2, 0x21, 0x2e, 0xc0, 0x13, 0xa, 0xb2, 0xec, 0x81, 0x13}} return a, nil } @@ -1437,7 +1437,7 @@ func _1665079662_add_spectated_column_in_communitiesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1665079662_add_spectated_column_in_communities.up.sql", size: 86, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1665079662_add_spectated_column_in_communities.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa0, 0x5d, 0xfe, 0xe2, 0xbe, 0xdf, 0xba, 0x45, 0xe9, 0xfc, 0xa7, 0x5f, 0xda, 0x19, 0xdb, 0x40, 0x96, 0x59, 0x78, 0xa, 0xd7, 0x4a, 0xca, 0x1a, 0x93, 0xfb, 0xae, 0x6d, 0x74, 0x7, 0x36, 0xdd}} return a, nil } @@ -1457,7 +1457,7 @@ func _1665479047_add_community_id_in_notificationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1665479047_add_community_id_in_notifications.up.sql", size: 169, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1665479047_add_community_id_in_notifications.up.sql", size: 169, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd9, 0x8f, 0x8b, 0x1c, 0xaa, 0x6a, 0x56, 0xd6, 0xa5, 0x88, 0x57, 0x13, 0x8f, 0xea, 0xb9, 0x23, 0x82, 0x50, 0xb7, 0x65, 0x1f, 0xab, 0xfa, 0x23, 0x6f, 0x0, 0x7, 0xb6, 0x6e, 0xb5, 0x85, 0x44}} return a, nil } @@ -1477,7 +1477,7 @@ func _1665484435_add_encrypted_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1665484435_add_encrypted_messages.up.sql", size: 402, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1665484435_add_encrypted_messages.up.sql", size: 402, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0x5c, 0x1e, 0x1c, 0x7f, 0xae, 0x5f, 0xeb, 0x3c, 0x6c, 0xcd, 0xc2, 0x99, 0x48, 0x5c, 0x83, 0xa0, 0xa2, 0x97, 0x5, 0x39, 0x82, 0x71, 0x90, 0x47, 0x21, 0x84, 0x29, 0x19, 0xa4, 0x7a, 0x90}} return a, nil } @@ -1497,7 +1497,7 @@ func _1665560200_add_contact_verification_individualUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1665560200_add_contact_verification_individual.up.sql", size: 509, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1665560200_add_contact_verification_individual.up.sql", size: 509, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc5, 0xbb, 0x61, 0xfd, 0xbf, 0x33, 0x1d, 0x4e, 0x5f, 0xbd, 0x86, 0x42, 0xb0, 0x6c, 0xf7, 0x39, 0x19, 0x6e, 0x72, 0x35, 0xfd, 0x1b, 0xd6, 0xbd, 0xf6, 0x81, 0x21, 0xc4, 0xaa, 0x6, 0x62, 0x40}} return a, nil } @@ -1517,7 +1517,7 @@ func _1670921937_add_album_idUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1670921937_add_album_id.up.sql", size: 55, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1670921937_add_album_id.up.sql", size: 55, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xae, 0x83, 0x58, 0xb7, 0x77, 0x5, 0xca, 0xe3, 0xda, 0x32, 0x8f, 0x7b, 0xa4, 0x2f, 0x4c, 0xaf, 0x5f, 0xfa, 0x94, 0x36, 0xe4, 0xf9, 0x7, 0xc6, 0xd6, 0xb7, 0x90, 0xf3, 0xe5, 0xb5, 0x3}} return a, nil } @@ -1537,7 +1537,7 @@ func _1673373000_add_repliedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1673373000_add_replied.up.sql", size: 67, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1673373000_add_replied.up.sql", size: 67, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0x1c, 0xae, 0xf2, 0xf, 0xb4, 0xc2, 0xba, 0x3c, 0xfe, 0x7b, 0xb0, 0xf, 0xf, 0xd5, 0xbc, 0xe2, 0xa7, 0xad, 0x50, 0xd9, 0x5a, 0xe8, 0x96, 0x22, 0x65, 0x89, 0xcf, 0x4a, 0x9a, 0x1b, 0x94}} return a, nil } @@ -1557,7 +1557,7 @@ func _1673428910_add_image_width_heightUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1673428910_add_image_width_height.up.sql", size: 117, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1673428910_add_image_width_height.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x74, 0xda, 0x93, 0x2a, 0x9b, 0x6b, 0xb7, 0x96, 0xcd, 0xac, 0xf, 0xaf, 0x54, 0x89, 0x9e, 0x91, 0x5b, 0xd0, 0x4a, 0xa, 0x8d, 0x9e, 0x80, 0x66, 0x26, 0x9e, 0xb5, 0xa9, 0x8, 0xec, 0x2d, 0x6c}} return a, nil } @@ -1577,7 +1577,7 @@ func _1674210659_add_contact_request_local_clockUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674210659_add_contact_request_local_clock.up.sql", size: 691, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1674210659_add_contact_request_local_clock.up.sql", size: 691, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x92, 0x72, 0x39, 0xfe, 0x72, 0x98, 0xfc, 0x91, 0x20, 0x10, 0xe8, 0xf5, 0xac, 0x79, 0xa8, 0x1c, 0xca, 0x7b, 0x35, 0xa, 0xc1, 0x56, 0x49, 0x9a, 0xfc, 0xbd, 0x64, 0x9d, 0xdf, 0xd2, 0x60, 0x70}} return a, nil } @@ -1597,7 +1597,7 @@ func _1675212323_add_deleted_byUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1675212323_add_deleted_by.up.sql", size: 57, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1675212323_add_deleted_by.up.sql", size: 57, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x85, 0x37, 0x29, 0x2f, 0xd, 0x5a, 0xb6, 0xdb, 0xa7, 0x8, 0x86, 0xfc, 0x7a, 0x70, 0xd8, 0x4d, 0xe6, 0xf0, 0x57, 0xe7, 0xd1, 0x95, 0xd5, 0x4, 0x40, 0x2f, 0x7a, 0x5, 0x4f, 0xc2, 0x97, 0xbc}} return a, nil } @@ -1617,7 +1617,7 @@ func _1675247084_add_activity_center_statesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1675247084_add_activity_center_states.up.sql", size: 136, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1675247084_add_activity_center_states.up.sql", size: 136, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xba, 0x90, 0x7d, 0x55, 0xc7, 0x40, 0x29, 0x26, 0x97, 0x45, 0x5c, 0xdf, 0xba, 0x61, 0xb, 0xfc, 0x3d, 0x7a, 0x6c, 0x42, 0xe4, 0x95, 0x78, 0xb0, 0xc5, 0x1f, 0x73, 0xe9, 0x33, 0x51, 0xc8, 0x81}} return a, nil } @@ -1637,7 +1637,7 @@ func _1675272329_fix_protocol_migrationUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1675272329_fix_protocol_migration.up.sql", size: 183, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1675272329_fix_protocol_migration.up.sql", size: 183, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0xe0, 0x11, 0x4c, 0x66, 0x55, 0x72, 0xd3, 0xe6, 0x98, 0xa4, 0xe7, 0x44, 0xf9, 0x3b, 0x3a, 0x3f, 0xd9, 0x91, 0x1e, 0x4f, 0xfc, 0x56, 0x63, 0xe5, 0xa4, 0x83, 0xfc, 0x7c, 0xcf, 0x18, 0x99}} return a, nil } @@ -1657,7 +1657,7 @@ func _1676998418_fix_activity_center_migrationUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676998418_fix_activity_center_migration.up.sql", size: 178, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1676998418_fix_activity_center_migration.up.sql", size: 178, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8a, 0xdc, 0x64, 0xb1, 0x47, 0x67, 0xda, 0x2c, 0x26, 0x29, 0x6b, 0x6f, 0xb, 0xfa, 0x45, 0xf3, 0xad, 0x8b, 0x1a, 0x5f, 0x1c, 0xed, 0xd7, 0xea, 0x54, 0xf5, 0x3f, 0xb8, 0xf6, 0xf9, 0x44, 0x53}} return a, nil } @@ -1677,7 +1677,7 @@ func _1677278861_add_deleted_column_to_activity_center_notifications_tableUpSql( return nil, err } - info := bindataFileInfo{name: "1677278861_add_deleted_column_to_activity_center_notifications_table.up.sql", size: 381, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1677278861_add_deleted_column_to_activity_center_notifications_table.up.sql", size: 381, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x38, 0x3a, 0x95, 0xaf, 0x81, 0xb0, 0x85, 0x8d, 0x73, 0xda, 0x7b, 0x2a, 0x35, 0xa6, 0xaa, 0xcc, 0x4c, 0x35, 0xa3, 0xa8, 0xbd, 0xd1, 0x37, 0xe8, 0x5d, 0x83, 0xa4, 0x33, 0x1f, 0x10, 0xe4, 0xe6}} return a, nil } @@ -1697,7 +1697,7 @@ func _1677486338_add_community_tokens_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1677486338_add_community_tokens_table.up.sql", size: 527, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1677486338_add_community_tokens_table.up.sql", size: 527, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfb, 0x7b, 0x3d, 0x7e, 0x79, 0xc4, 0x3a, 0xf1, 0xda, 0x4b, 0xc6, 0xd1, 0xd, 0xfb, 0xb2, 0xb9, 0x7f, 0x81, 0x29, 0xab, 0xd8, 0x1, 0x20, 0xd7, 0xe1, 0xaf, 0x3e, 0x67, 0x1b, 0xdb, 0xf9, 0xd5}} return a, nil } @@ -1717,7 +1717,7 @@ func _1678292329_add_collapsed_categoriesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1678292329_add_collapsed_categories.up.sql", size: 170, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1678292329_add_collapsed_categories.up.sql", size: 170, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0x63, 0x86, 0xd5, 0x7, 0xe2, 0x25, 0x15, 0x1b, 0xfe, 0xf3, 0xe, 0x50, 0x48, 0x11, 0x3c, 0x7c, 0xc6, 0xe5, 0xab, 0x8d, 0x1f, 0xe8, 0x3c, 0xcb, 0xf0, 0x8d, 0xa7, 0x49, 0x4c, 0x16, 0x4f}} return a, nil } @@ -1737,7 +1737,7 @@ func _1678800760_add_index_to_raw_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1678800760_add_index_to_raw_messages.up.sql", size: 88, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1678800760_add_index_to_raw_messages.up.sql", size: 88, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9d, 0xd9, 0x8d, 0x22, 0x46, 0xae, 0x7b, 0x53, 0x3e, 0x51, 0x39, 0xad, 0xad, 0x38, 0x50, 0x6, 0xfa, 0xb9, 0xc4, 0x9f, 0x8d, 0xd2, 0x67, 0x0, 0xef, 0x58, 0x13, 0xab, 0x6a, 0x67, 0xf3, 0x7e}} return a, nil } @@ -1757,7 +1757,7 @@ func _1678877478_add_communities_requests_to_join_revealed_addresses_tableUpSql( return nil, err } - info := bindataFileInfo{name: "1678877478_add_communities_requests_to_join_revealed_addresses_table.up.sql", size: 168, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1678877478_add_communities_requests_to_join_revealed_addresses_table.up.sql", size: 168, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x82, 0x1, 0xb4, 0xb2, 0x94, 0x25, 0xd5, 0x2e, 0x45, 0xc3, 0xb1, 0x2c, 0xeb, 0x1a, 0x52, 0xe0, 0x4b, 0x9b, 0x46, 0xf4, 0xc, 0xac, 0x1, 0x1e, 0x90, 0xbc, 0x64, 0x38, 0x10, 0xf1, 0xaf, 0xac}} return a, nil } @@ -1777,7 +1777,7 @@ func _1679326850_add_community_token_ownersUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1679326850_add_community_token_owners.up.sql", size: 206, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1679326850_add_community_token_owners.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe9, 0xe6, 0x25, 0x67, 0xd1, 0xd6, 0x54, 0x88, 0xb1, 0x80, 0x1e, 0x2d, 0x9c, 0xfa, 0x1c, 0xc7, 0x63, 0x6e, 0xf9, 0x66, 0xb1, 0x68, 0xc6, 0xf8, 0x51, 0xb6, 0xd5, 0x4e, 0x93, 0x39, 0x5e, 0xc0}} return a, nil } @@ -1797,7 +1797,7 @@ func _1680011500_add_album_images_countUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1680011500_add_album_images_count.up.sql", size: 71, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1680011500_add_album_images_count.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2e, 0x55, 0x99, 0x31, 0xcc, 0x80, 0x78, 0xc3, 0x51, 0x13, 0x63, 0x6f, 0x1a, 0xfd, 0x53, 0xd2, 0xf4, 0x13, 0x4b, 0xb2, 0x4f, 0x99, 0xb8, 0x7b, 0x7, 0x99, 0xb6, 0xab, 0x88, 0x2e, 0x7, 0x8}} return a, nil } @@ -1817,7 +1817,7 @@ func _1680114896_add_index_on_album_idUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1680114896_add_index_on_album_id.up.sql", size: 83, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1680114896_add_index_on_album_id.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb3, 0x7e, 0xd5, 0xcd, 0x2d, 0xab, 0xd4, 0x32, 0x26, 0x50, 0x3a, 0x5b, 0x8e, 0x1c, 0xcc, 0x35, 0xf8, 0xa1, 0x2a, 0xc1, 0x23, 0xf6, 0x90, 0xfe, 0x84, 0x3, 0xde, 0x5a, 0xee, 0xc6, 0xfc, 0x2a}} return a, nil } @@ -1837,7 +1837,7 @@ func _1681655289_add_mute_tillUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681655289_add_mute_till.up.sql", size: 51, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681655289_add_mute_till.up.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0xbe, 0xce, 0xb8, 0xe1, 0x30, 0xe7, 0xa7, 0xe0, 0x7d, 0x97, 0xf4, 0x26, 0xb8, 0x57, 0x1d, 0x2a, 0xed, 0x18, 0xf2, 0xa, 0xe3, 0x77, 0x29, 0x18, 0x55, 0x9, 0x74, 0x2c, 0x24, 0x5a, 0x19}} return a, nil } @@ -1857,7 +1857,7 @@ func _1681934966_add_index_response_toUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681934966_add_index_response_to.up.sql", size: 70, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1681934966_add_index_response_to.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1684180118, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3b, 0xed, 0xa6, 0x7e, 0x51, 0xf2, 0xa1, 0x3c, 0x78, 0x9a, 0xa7, 0x7a, 0x51, 0x25, 0x7d, 0xdd, 0x4b, 0xf3, 0x45, 0xeb, 0x3f, 0xad, 0x23, 0x3e, 0xac, 0x16, 0x28, 0x62, 0x7, 0x8c, 0xe0, 0xa0}} return a, nil } @@ -1877,7 +1877,7 @@ func _1682528339_add_index_user_messages_unseenUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1682528339_add_index_user_messages_unseen.up.sql", size: 104, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1682528339_add_index_user_messages_unseen.up.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1684360395, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x35, 0xfa, 0x98, 0xdd, 0x74, 0x5e, 0x21, 0x1f, 0xf2, 0x56, 0x17, 0x96, 0xfe, 0xbb, 0x44, 0x4c, 0xa1, 0xd8, 0x9f, 0x2e, 0x6, 0x2f, 0xd8, 0x23, 0xec, 0x94, 0x8c, 0x53, 0xf3, 0xf0, 0x40, 0xe7}} return a, nil } @@ -1897,7 +1897,7 @@ func _1683707289_recreate_deleted_for_mesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683707289_recreate_deleted_for_mes.up.sql", size: 408, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1683707289_recreate_deleted_for_mes.up.sql", size: 408, mode: os.FileMode(0644), modTime: time.Unix(1684360395, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5b, 0x9d, 0xd6, 0x45, 0x41, 0x29, 0x44, 0xf6, 0x14, 0x38, 0xeb, 0xdf, 0x6b, 0x5d, 0x9c, 0x45, 0x4b, 0xc3, 0xa8, 0xbd, 0x38, 0x14, 0xd9, 0x73, 0xf1, 0x51, 0xbb, 0x9f, 0x14, 0x36, 0xf2, 0x11}} return a, nil } @@ -1917,7 +1917,7 @@ func _1683725607_mark_discord_messages_as_seenUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683725607_mark_discord_messages_as_seen.up.sql", size: 108, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "1683725607_mark_discord_messages_as_seen.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1684360395, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd7, 0x2a, 0xc3, 0x43, 0xea, 0x5e, 0x3, 0x2e, 0xce, 0x79, 0xea, 0xa5, 0x67, 0x61, 0x8c, 0xe4, 0xb9, 0xb7, 0x4d, 0xd5, 0xd5, 0xb0, 0x35, 0xc8, 0x2b, 0xa0, 0x3f, 0xd8, 0xde, 0xea, 0x4e, 0x16}} return a, nil } @@ -1937,7 +1937,7 @@ func _1684174617_add_url_previews_to_user_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1684174617_add_url_previews_to_user_messages.up.sql", size: 58, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1684174617_add_url_previews_to_user_messages.up.sql", size: 58, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdc, 0xb0, 0x72, 0xe3, 0xe4, 0xa9, 0x63, 0x82, 0xea, 0x52, 0x70, 0xb6, 0xa0, 0x73, 0x55, 0x7a, 0x78, 0xa8, 0xd2, 0xb0, 0xf4, 0x78, 0x8a, 0xd, 0x5a, 0xa2, 0x9d, 0x92, 0xdc, 0xce, 0x1c, 0x71}} return a, nil } @@ -1957,7 +1957,7 @@ func _1684175608_add_token_balancesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1684175608_add_token_balances.up.sql", size: 467, mode: os.FileMode(0664), modTime: time.Unix(1685964136, 0)} + info := bindataFileInfo{name: "1684175608_add_token_balances.up.sql", size: 467, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1b, 0x4e, 0xe0, 0x48, 0x34, 0x1, 0x4d, 0x88, 0x11, 0x54, 0x20, 0x52, 0x5c, 0x57, 0x14, 0xa9, 0xa9, 0x36, 0xa4, 0x28, 0x59, 0x48, 0xa8, 0xa, 0x76, 0xec, 0x37, 0xee, 0x9e, 0xd2, 0x20, 0xaa}} return a, nil } @@ -1977,7 +1977,7 @@ func _1684979808_sync_activity_center_notificationsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1684979808_sync_activity_center_notifications.up.sql", size: 169, mode: os.FileMode(0664), modTime: time.Unix(1686553047, 0)} + info := bindataFileInfo{name: "1684979808_sync_activity_center_notifications.up.sql", size: 169, mode: os.FileMode(0644), modTime: time.Unix(1686642106, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd8, 0xf5, 0xf7, 0x94, 0xa9, 0xa1, 0x60, 0x26, 0x9d, 0xca, 0x31, 0xf, 0x14, 0xd, 0x70, 0xf8, 0xab, 0x40, 0x29, 0x73, 0x61, 0xbd, 0x1b, 0xb6, 0xc4, 0x31, 0x77, 0x9e, 0x32, 0xa8, 0xce, 0x6d}} return a, nil } @@ -1997,7 +1997,7 @@ func _1685964183_add_chainids_to_revealed_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685964183_add_chainids_to_revealed_addresses.up.sql", size: 88, mode: os.FileMode(0664), modTime: time.Unix(1686553047, 0)} + info := bindataFileInfo{name: "1685964183_add_chainids_to_revealed_addresses.up.sql", size: 88, mode: os.FileMode(0644), modTime: time.Unix(1686642106, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc, 0xb5, 0xa8, 0xd7, 0xad, 0x9c, 0x54, 0xa5, 0xe9, 0xdb, 0x42, 0x2d, 0xd0, 0xd7, 0x22, 0x1, 0x93, 0xf3, 0x4f, 0x53, 0xf7, 0x1e, 0xbe, 0x4b, 0xac, 0xc7, 0x63, 0x15, 0xdf, 0xe0, 0x6, 0xf8}} return a, nil } @@ -2017,7 +2017,7 @@ func readmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "README.md", size: 554, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "README.md", size: 554, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1c, 0x6e, 0xfb, 0xcc, 0x81, 0x94, 0x4d, 0x8c, 0xa0, 0x3b, 0x5, 0xb0, 0x18, 0xd6, 0xbb, 0xb3, 0x79, 0xc8, 0x8f, 0xff, 0xc1, 0x10, 0xf9, 0xf, 0x20, 0x1b, 0x4a, 0x74, 0x96, 0x42, 0xd7, 0xa8}} return a, nil } @@ -2037,7 +2037,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 850, mode: os.FileMode(0664), modTime: time.Unix(1685952633, 0)} + info := bindataFileInfo{name: "doc.go", size: 850, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa0, 0xcc, 0x41, 0xe1, 0x61, 0x12, 0x97, 0xe, 0x36, 0x8c, 0xa7, 0x9e, 0xe0, 0x6e, 0x59, 0x9e, 0xee, 0xd5, 0x4a, 0xcf, 0x1e, 0x60, 0xd6, 0xc3, 0x3a, 0xc9, 0x6c, 0xf2, 0x86, 0x5a, 0xb4, 0x1e}} return a, nil } diff --git a/protocol/protobuf/application_metadata_message.pb.go b/protocol/protobuf/application_metadata_message.pb.go index 91436990b..1bbc3481f 100644 --- a/protocol/protobuf/application_metadata_message.pb.go +++ b/protocol/protobuf/application_metadata_message.pb.go @@ -91,6 +91,7 @@ const ( ApplicationMetadataMessage_SYNC_FULL_KEYPAIR ApplicationMetadataMessage_Type = 66 ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION ApplicationMetadataMessage_Type = 67 ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE ApplicationMetadataMessage_Type = 68 + ApplicationMetadataMessage_COMMUNITY_ADMIN_MESSAGE ApplicationMetadataMessage_Type = 69 ) var ApplicationMetadataMessage_Type_name = map[int32]string{ @@ -162,6 +163,7 @@ var ApplicationMetadataMessage_Type_name = map[int32]string{ 66: "SYNC_FULL_KEYPAIR", 67: "SYNC_ACTIVITY_CENTER_NOTIFICATION", 68: "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE", + 69: "COMMUNITY_ADMIN_MESSAGE", } var ApplicationMetadataMessage_Type_value = map[string]int32{ @@ -233,6 +235,7 @@ var ApplicationMetadataMessage_Type_value = map[string]int32{ "SYNC_FULL_KEYPAIR": 66, "SYNC_ACTIVITY_CENTER_NOTIFICATION": 67, "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE": 68, + "COMMUNITY_ADMIN_MESSAGE": 69, } func (x ApplicationMetadataMessage_Type) String() string { @@ -311,12 +314,12 @@ func init() { } var fileDescriptor_ad09a6406fcf24c7 = []byte{ - // 976 bytes of a gzipped FileDescriptorProto + // 985 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0x6d, 0x73, 0x13, 0x37, 0x10, 0x6e, 0x20, 0x4d, 0x40, 0x79, 0x53, 0x44, 0x5e, 0x9c, 0x77, 0xc7, 0x40, 0x08, 0xd0, 0x9a, 0x16, 0xda, 0x4e, 0x5b, 0x4a, 0x5b, 0x59, 0xda, 0xd8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, 0xd9, 0xcb, 0xfc, 0x9b, 0xfe, 0x76, 0x26, 0xf9, - 0xef, 0xc5, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x53, 0x02, 0xd0, 0x7a, 0x08, 0x00, 0x00, + 0x0b, 0xc0, 0xdc, 0x8b, 0x68, 0x42, 0xf3, 0x3c, 0x9c, 0xb8, 0x34, 0xd0, 0x5a, 0xf8, 0x73, 0xae, + 0xf9, 0xec, 0x65, 0xfe, 0xc1, 0x7f, 0x3b, 0x93, 0xfc, 0xf7, 0xe2, 0xbf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xe0, 0x3a, 0xd3, 0x3a, 0x97, 0x08, 0x00, 0x00, } diff --git a/protocol/protobuf/application_metadata_message.proto b/protocol/protobuf/application_metadata_message.proto index fa1a569ca..3a4d94208 100644 --- a/protocol/protobuf/application_metadata_message.proto +++ b/protocol/protobuf/application_metadata_message.proto @@ -81,5 +81,6 @@ message ApplicationMetadataMessage { SYNC_FULL_KEYPAIR = 66; SYNC_ACTIVITY_CENTER_NOTIFICATION = 67; SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE = 68; + COMMUNITY_ADMIN_MESSAGE = 69; } } diff --git a/protocol/protobuf/communities.pb.go b/protocol/protobuf/communities.pb.go index 2b50b37d9..89be36582 100644 --- a/protocol/protobuf/communities.pb.go +++ b/protocol/protobuf/communities.pb.go @@ -23,24 +23,27 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type CommunityMember_Roles int32 const ( - CommunityMember_UNKNOWN_ROLE CommunityMember_Roles = 0 - CommunityMember_ROLE_ALL CommunityMember_Roles = 1 + CommunityMember_ROLE_NONE CommunityMember_Roles = 0 + CommunityMember_ROLE_OWNER CommunityMember_Roles = 1 CommunityMember_ROLE_MANAGE_USERS CommunityMember_Roles = 2 CommunityMember_ROLE_MODERATE_CONTENT CommunityMember_Roles = 3 + CommunityMember_ROLE_ADMIN CommunityMember_Roles = 4 ) var CommunityMember_Roles_name = map[int32]string{ - 0: "UNKNOWN_ROLE", - 1: "ROLE_ALL", + 0: "ROLE_NONE", + 1: "ROLE_OWNER", 2: "ROLE_MANAGE_USERS", 3: "ROLE_MODERATE_CONTENT", + 4: "ROLE_ADMIN", } var CommunityMember_Roles_value = map[string]int32{ - "UNKNOWN_ROLE": 0, - "ROLE_ALL": 1, + "ROLE_NONE": 0, + "ROLE_OWNER": 1, "ROLE_MANAGE_USERS": 2, "ROLE_MODERATE_CONTENT": 3, + "ROLE_ADMIN": 4, } func (x CommunityMember_Roles) String() string { @@ -1648,129 +1651,130 @@ func init() { } var fileDescriptor_f937943d74c1cd8b = []byte{ - // 1984 bytes of a gzipped FileDescriptorProto + // 1991 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x73, 0x23, 0x47, - 0x15, 0xdf, 0x91, 0x64, 0x5b, 0x7a, 0x92, 0xbd, 0x72, 0xef, 0x1f, 0x8f, 0xbd, 0xbb, 0x59, 0xed, - 0x00, 0x85, 0x53, 0x14, 0xda, 0xc4, 0x81, 0x62, 0x2b, 0x81, 0x24, 0x5a, 0x59, 0x6c, 0xc4, 0x5a, - 0x23, 0xa7, 0xa5, 0xcd, 0x92, 0x14, 0x30, 0xd5, 0x9e, 0x69, 0xcb, 0x5d, 0x2b, 0xcd, 0x88, 0xe9, + 0x15, 0xcf, 0x48, 0xb2, 0x2d, 0x3d, 0x49, 0x5e, 0xb9, 0xf7, 0x8f, 0xc7, 0xde, 0xdd, 0xac, 0x77, + 0x80, 0xc2, 0x29, 0x0a, 0x6d, 0xe2, 0x40, 0xb1, 0x95, 0x40, 0x12, 0xad, 0x3c, 0x6c, 0xc4, 0xae, + 0x47, 0x4e, 0x4b, 0x9b, 0x85, 0x14, 0x30, 0xd5, 0x9e, 0x69, 0xcb, 0x5d, 0x2b, 0xcd, 0x88, 0xe9, 0x96, 0x0b, 0x71, 0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0xcd, 0xae, 0xfb, 0x59, 0x77, 0xd8, 0x1a, 0x76, 0xfb, 0xae, 0xd7, 0x77, - 0x4f, 0x3e, 0xaf, 0x17, 0xd0, 0x0e, 0x40, 0xdf, 0xf5, 0x70, 0xe7, 0xd3, 0x17, 0x9d, 0x81, 0xc4, - 0xd2, 0xef, 0x8a, 0xb0, 0xad, 0xa2, 0xdd, 0x8e, 0x99, 0xa0, 0x31, 0x23, 0xe8, 0x97, 0xaf, 0x81, - 0x50, 0x73, 0x71, 0xe4, 0xdc, 0xa6, 0xaf, 0x80, 0x9c, 0x77, 0xa0, 0x24, 0x64, 0xf2, 0x0b, 0x6f, - 0x90, 0x7c, 0x25, 0x99, 0xc9, 0x7b, 0x71, 0x65, 0xde, 0x4b, 0x8b, 0xbc, 0x4b, 0x59, 0x32, 0x91, - 0x17, 0x30, 0xc1, 0x88, 0xa6, 0x64, 0xb1, 0x51, 0x40, 0xf2, 0x58, 0xc0, 0xed, 0xcd, 0x46, 0xf1, - 0xb0, 0x84, 0xcb, 0x8a, 0xd1, 0x0d, 0x38, 0x7a, 0x08, 0x55, 0x99, 0xcd, 0x29, 0x11, 0x82, 0xc6, - 0xa1, 0xbd, 0xa5, 0x76, 0x02, 0x0d, 0xf9, 0xa9, 0xe6, 0xa0, 0x03, 0x28, 0x07, 0xd4, 0x67, 0x13, - 0x32, 0xe6, 0x76, 0x59, 0x01, 0x27, 0xa5, 0xff, 0x47, 0x48, 0xfb, 0x7b, 0x01, 0xec, 0x7c, 0x00, - 0x16, 0x48, 0x40, 0x3b, 0x50, 0x30, 0x25, 0xb4, 0x82, 0x0b, 0x2c, 0x40, 0x1f, 0xe4, 0x42, 0xf8, - 0xdd, 0x75, 0x21, 0x5c, 0x68, 0x68, 0x66, 0xa2, 0xf9, 0x21, 0xec, 0xe8, 0x48, 0xf8, 0x26, 0x77, - 0x76, 0x51, 0xa5, 0x76, 0x6f, 0x4d, 0x6a, 0xf1, 0xb6, 0xc8, 0xc1, 0x63, 0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0x15, 0x00, 0x00, } diff --git a/protocol/protobuf/communities.proto b/protocol/protobuf/communities.proto index 2004e1aa2..e5f93b21c 100644 --- a/protocol/protobuf/communities.proto +++ b/protocol/protobuf/communities.proto @@ -15,10 +15,11 @@ message Grant { message CommunityMember { enum Roles { - UNKNOWN_ROLE = 0; - ROLE_ALL = 1; + ROLE_NONE = 0; + ROLE_OWNER = 1; ROLE_MANAGE_USERS = 2; ROLE_MODERATE_CONTENT = 3; + ROLE_ADMIN = 4; } repeated Roles roles = 1; repeated RevealedAccount revealed_accounts = 2; diff --git a/protocol/protobuf/community_admin_update.pb.go b/protocol/protobuf/community_admin_update.pb.go new file mode 100644 index 000000000..4ef77f844 --- /dev/null +++ b/protocol/protobuf/community_admin_update.pb.go @@ -0,0 +1,495 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: community_admin_update.proto + +package protobuf + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type CommunityAdminEvent_EventType int32 + +const ( + CommunityAdminEvent_UNKNOWN CommunityAdminEvent_EventType = 0 + CommunityAdminEvent_COMMUNITY_EDIT CommunityAdminEvent_EventType = 1 + CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE CommunityAdminEvent_EventType = 2 + CommunityAdminEvent_COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE CommunityAdminEvent_EventType = 3 + CommunityAdminEvent_COMMUNITY_CATEGORY_CREATE CommunityAdminEvent_EventType = 4 + CommunityAdminEvent_COMMUNITY_CATEGORY_DELETE CommunityAdminEvent_EventType = 5 + CommunityAdminEvent_COMMUNITY_CATEGORY_EDIT CommunityAdminEvent_EventType = 6 + CommunityAdminEvent_COMMUNITY_CHANNEL_CREATE CommunityAdminEvent_EventType = 7 + CommunityAdminEvent_COMMUNITY_CHANNEL_DELETE CommunityAdminEvent_EventType = 8 + CommunityAdminEvent_COMMUNITY_CHANNEL_EDIT CommunityAdminEvent_EventType = 9 + CommunityAdminEvent_COMMUNITY_CATEGORY_REORDER CommunityAdminEvent_EventType = 10 + CommunityAdminEvent_COMMUNITY_CHANNEL_REORDER CommunityAdminEvent_EventType = 11 + CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_ACCEPT CommunityAdminEvent_EventType = 12 + CommunityAdminEvent_COMMUNITY_REQUEST_TO_JOIN_REJECT CommunityAdminEvent_EventType = 13 + CommunityAdminEvent_COMMUNITY_MEMBER_KICK CommunityAdminEvent_EventType = 14 + CommunityAdminEvent_COMMUNITY_MEMBER_BAN CommunityAdminEvent_EventType = 15 + CommunityAdminEvent_COMMUNITY_MEMBER_UNBAN CommunityAdminEvent_EventType = 16 +) + +var CommunityAdminEvent_EventType_name = map[int32]string{ + 0: "UNKNOWN", + 1: "COMMUNITY_EDIT", + 2: "COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE", + 3: "COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE", + 4: "COMMUNITY_CATEGORY_CREATE", + 5: "COMMUNITY_CATEGORY_DELETE", + 6: "COMMUNITY_CATEGORY_EDIT", + 7: "COMMUNITY_CHANNEL_CREATE", + 8: "COMMUNITY_CHANNEL_DELETE", + 9: "COMMUNITY_CHANNEL_EDIT", + 10: "COMMUNITY_CATEGORY_REORDER", + 11: "COMMUNITY_CHANNEL_REORDER", + 12: "COMMUNITY_REQUEST_TO_JOIN_ACCEPT", + 13: "COMMUNITY_REQUEST_TO_JOIN_REJECT", + 14: "COMMUNITY_MEMBER_KICK", + 15: "COMMUNITY_MEMBER_BAN", + 16: "COMMUNITY_MEMBER_UNBAN", +} + +var CommunityAdminEvent_EventType_value = map[string]int32{ + "UNKNOWN": 0, + "COMMUNITY_EDIT": 1, + "COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE": 2, + "COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE": 3, + "COMMUNITY_CATEGORY_CREATE": 4, + "COMMUNITY_CATEGORY_DELETE": 5, + "COMMUNITY_CATEGORY_EDIT": 6, + "COMMUNITY_CHANNEL_CREATE": 7, + "COMMUNITY_CHANNEL_DELETE": 8, + "COMMUNITY_CHANNEL_EDIT": 9, + "COMMUNITY_CATEGORY_REORDER": 10, + "COMMUNITY_CHANNEL_REORDER": 11, + "COMMUNITY_REQUEST_TO_JOIN_ACCEPT": 12, + "COMMUNITY_REQUEST_TO_JOIN_REJECT": 13, + "COMMUNITY_MEMBER_KICK": 14, + "COMMUNITY_MEMBER_BAN": 15, + "COMMUNITY_MEMBER_UNBAN": 16, +} + +func (x CommunityAdminEvent_EventType) String() string { + return proto.EnumName(CommunityAdminEvent_EventType_name, int32(x)) +} + +func (CommunityAdminEvent_EventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_22a3f5c92e845a9d, []int{0, 0} +} + +type CommunityAdminEvent struct { + Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"` + CommunityId []byte `protobuf:"bytes,2,opt,name=community_id,json=communityId,proto3" json:"community_id,omitempty"` + Type CommunityAdminEvent_EventType `protobuf:"varint,3,opt,name=type,proto3,enum=protobuf.CommunityAdminEvent_EventType" json:"type,omitempty"` + CommunityConfig *CommunityConfig `protobuf:"bytes,4,opt,name=community_config,json=communityConfig,proto3" json:"community_config,omitempty"` + TokenPermissions map[string]*CommunityTokenPermission `protobuf:"bytes,5,rep,name=token_permissions,json=tokenPermissions,proto3" json:"token_permissions,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + CategoryData *CategoryData `protobuf:"bytes,6,opt,name=category_data,json=categoryData,proto3" json:"category_data,omitempty"` + ChannelData *ChannelData `protobuf:"bytes,7,opt,name=channel_data,json=channelData,proto3" json:"channel_data,omitempty"` + MemberToAction string `protobuf:"bytes,8,opt,name=member_to_action,json=memberToAction,proto3" json:"member_to_action,omitempty"` + MembersAdded map[string]*CommunityMember `protobuf:"bytes,9,rep,name=membersAdded,proto3" json:"membersAdded,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + RejectedRequestsToJoin map[string]*CommunityRequestToJoin `protobuf:"bytes,10,rep,name=rejectedRequestsToJoin,proto3" json:"rejectedRequestsToJoin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + AcceptedRequestsToJoin map[string]*CommunityRequestToJoin `protobuf:"bytes,11,rep,name=acceptedRequestsToJoin,proto3" json:"acceptedRequestsToJoin,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommunityAdminEvent) Reset() { *m = CommunityAdminEvent{} } +func (m *CommunityAdminEvent) String() string { return proto.CompactTextString(m) } +func (*CommunityAdminEvent) ProtoMessage() {} +func (*CommunityAdminEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_22a3f5c92e845a9d, []int{0} +} + +func (m *CommunityAdminEvent) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommunityAdminEvent.Unmarshal(m, b) +} +func (m *CommunityAdminEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommunityAdminEvent.Marshal(b, m, deterministic) +} +func (m *CommunityAdminEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommunityAdminEvent.Merge(m, src) +} +func (m *CommunityAdminEvent) XXX_Size() int { + return xxx_messageInfo_CommunityAdminEvent.Size(m) +} +func (m *CommunityAdminEvent) XXX_DiscardUnknown() { + xxx_messageInfo_CommunityAdminEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_CommunityAdminEvent proto.InternalMessageInfo + +func (m *CommunityAdminEvent) GetClock() uint64 { + if m != nil { + return m.Clock + } + return 0 +} + +func (m *CommunityAdminEvent) GetCommunityId() []byte { + if m != nil { + return m.CommunityId + } + return nil +} + +func (m *CommunityAdminEvent) GetType() CommunityAdminEvent_EventType { + if m != nil { + return m.Type + } + return CommunityAdminEvent_UNKNOWN +} + +func (m *CommunityAdminEvent) GetCommunityConfig() *CommunityConfig { + if m != nil { + return m.CommunityConfig + } + return nil +} + +func (m *CommunityAdminEvent) GetTokenPermissions() map[string]*CommunityTokenPermission { + if m != nil { + return m.TokenPermissions + } + return nil +} + +func (m *CommunityAdminEvent) GetCategoryData() *CategoryData { + if m != nil { + return m.CategoryData + } + return nil +} + +func (m *CommunityAdminEvent) GetChannelData() *ChannelData { + if m != nil { + return m.ChannelData + } + return nil +} + +func (m *CommunityAdminEvent) GetMemberToAction() string { + if m != nil { + return m.MemberToAction + } + return "" +} + +func (m *CommunityAdminEvent) GetMembersAdded() map[string]*CommunityMember { + if m != nil { + return m.MembersAdded + } + return nil +} + +func (m *CommunityAdminEvent) GetRejectedRequestsToJoin() map[string]*CommunityRequestToJoin { + if m != nil { + return m.RejectedRequestsToJoin + } + return nil +} + +func (m *CommunityAdminEvent) GetAcceptedRequestsToJoin() map[string]*CommunityRequestToJoin { + if m != nil { + return m.AcceptedRequestsToJoin + } + return nil +} + +type CommunityConfig struct { + Identity *ChatIdentity `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + Permissions *CommunityPermissions `protobuf:"bytes,2,opt,name=permissions,proto3" json:"permissions,omitempty"` + AdminSettings *CommunityAdminSettings `protobuf:"bytes,3,opt,name=admin_settings,json=adminSettings,proto3" json:"admin_settings,omitempty"` + IntroMessage string `protobuf:"bytes,4,opt,name=intro_message,json=introMessage,proto3" json:"intro_message,omitempty"` + OutroMessage string `protobuf:"bytes,5,opt,name=outro_message,json=outroMessage,proto3" json:"outro_message,omitempty"` + Tags []string `protobuf:"bytes,6,rep,name=tags,proto3" json:"tags,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommunityConfig) Reset() { *m = CommunityConfig{} } +func (m *CommunityConfig) String() string { return proto.CompactTextString(m) } +func (*CommunityConfig) ProtoMessage() {} +func (*CommunityConfig) Descriptor() ([]byte, []int) { + return fileDescriptor_22a3f5c92e845a9d, []int{1} +} + +func (m *CommunityConfig) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommunityConfig.Unmarshal(m, b) +} +func (m *CommunityConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommunityConfig.Marshal(b, m, deterministic) +} +func (m *CommunityConfig) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommunityConfig.Merge(m, src) +} +func (m *CommunityConfig) XXX_Size() int { + return xxx_messageInfo_CommunityConfig.Size(m) +} +func (m *CommunityConfig) XXX_DiscardUnknown() { + xxx_messageInfo_CommunityConfig.DiscardUnknown(m) +} + +var xxx_messageInfo_CommunityConfig proto.InternalMessageInfo + +func (m *CommunityConfig) GetIdentity() *ChatIdentity { + if m != nil { + return m.Identity + } + return nil +} + +func (m *CommunityConfig) GetPermissions() *CommunityPermissions { + if m != nil { + return m.Permissions + } + return nil +} + +func (m *CommunityConfig) GetAdminSettings() *CommunityAdminSettings { + if m != nil { + return m.AdminSettings + } + return nil +} + +func (m *CommunityConfig) GetIntroMessage() string { + if m != nil { + return m.IntroMessage + } + return "" +} + +func (m *CommunityConfig) GetOutroMessage() string { + if m != nil { + return m.OutroMessage + } + return "" +} + +func (m *CommunityConfig) GetTags() []string { + if m != nil { + return m.Tags + } + return nil +} + +type CategoryData struct { + CategoryId string `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + ChannelsIds []string `protobuf:"bytes,3,rep,name=channels_ids,json=channelsIds,proto3" json:"channels_ids,omitempty"` + Position int32 `protobuf:"varint,4,opt,name=position,proto3" json:"position,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CategoryData) Reset() { *m = CategoryData{} } +func (m *CategoryData) String() string { return proto.CompactTextString(m) } +func (*CategoryData) ProtoMessage() {} +func (*CategoryData) Descriptor() ([]byte, []int) { + return fileDescriptor_22a3f5c92e845a9d, []int{2} +} + +func (m *CategoryData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CategoryData.Unmarshal(m, b) +} +func (m *CategoryData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CategoryData.Marshal(b, m, deterministic) +} +func (m *CategoryData) XXX_Merge(src proto.Message) { + xxx_messageInfo_CategoryData.Merge(m, src) +} +func (m *CategoryData) XXX_Size() int { + return xxx_messageInfo_CategoryData.Size(m) +} +func (m *CategoryData) XXX_DiscardUnknown() { + xxx_messageInfo_CategoryData.DiscardUnknown(m) +} + +var xxx_messageInfo_CategoryData proto.InternalMessageInfo + +func (m *CategoryData) GetCategoryId() string { + if m != nil { + return m.CategoryId + } + return "" +} + +func (m *CategoryData) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *CategoryData) GetChannelsIds() []string { + if m != nil { + return m.ChannelsIds + } + return nil +} + +func (m *CategoryData) GetPosition() int32 { + if m != nil { + return m.Position + } + return 0 +} + +type ChannelData struct { + CategoryId string `protobuf:"bytes,1,opt,name=category_id,json=categoryId,proto3" json:"category_id,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + Position int32 `protobuf:"varint,3,opt,name=position,proto3" json:"position,omitempty"` + Channel *CommunityChat `protobuf:"bytes,4,opt,name=channel,proto3" json:"channel,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelData) Reset() { *m = ChannelData{} } +func (m *ChannelData) String() string { return proto.CompactTextString(m) } +func (*ChannelData) ProtoMessage() {} +func (*ChannelData) Descriptor() ([]byte, []int) { + return fileDescriptor_22a3f5c92e845a9d, []int{3} +} + +func (m *ChannelData) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelData.Unmarshal(m, b) +} +func (m *ChannelData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelData.Marshal(b, m, deterministic) +} +func (m *ChannelData) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelData.Merge(m, src) +} +func (m *ChannelData) XXX_Size() int { + return xxx_messageInfo_ChannelData.Size(m) +} +func (m *ChannelData) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelData.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelData proto.InternalMessageInfo + +func (m *ChannelData) GetCategoryId() string { + if m != nil { + return m.CategoryId + } + return "" +} + +func (m *ChannelData) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *ChannelData) GetPosition() int32 { + if m != nil { + return m.Position + } + return 0 +} + +func (m *ChannelData) GetChannel() *CommunityChat { + if m != nil { + return m.Channel + } + return nil +} + +func init() { + proto.RegisterEnum("protobuf.CommunityAdminEvent_EventType", CommunityAdminEvent_EventType_name, CommunityAdminEvent_EventType_value) + proto.RegisterType((*CommunityAdminEvent)(nil), "protobuf.CommunityAdminEvent") + proto.RegisterMapType((map[string]*CommunityRequestToJoin)(nil), "protobuf.CommunityAdminEvent.AcceptedRequestsToJoinEntry") + proto.RegisterMapType((map[string]*CommunityMember)(nil), "protobuf.CommunityAdminEvent.MembersAddedEntry") + proto.RegisterMapType((map[string]*CommunityRequestToJoin)(nil), "protobuf.CommunityAdminEvent.RejectedRequestsToJoinEntry") + proto.RegisterMapType((map[string]*CommunityTokenPermission)(nil), "protobuf.CommunityAdminEvent.TokenPermissionsEntry") + proto.RegisterType((*CommunityConfig)(nil), "protobuf.CommunityConfig") + proto.RegisterType((*CategoryData)(nil), "protobuf.CategoryData") + proto.RegisterType((*ChannelData)(nil), "protobuf.ChannelData") +} + +func init() { + proto.RegisterFile("community_admin_update.proto", fileDescriptor_22a3f5c92e845a9d) +} + +var fileDescriptor_22a3f5c92e845a9d = []byte{ + // 950 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xdd, 0x6e, 0xe2, 0x46, + 0x14, 0xae, 0x03, 0x24, 0xf8, 0x18, 0x88, 0x33, 0xbb, 0xc9, 0x3a, 0xec, 0x4f, 0x29, 0xad, 0x54, + 0x5f, 0x54, 0x44, 0x65, 0xa5, 0x2a, 0x6d, 0x6e, 0xea, 0x98, 0x51, 0xd6, 0xc9, 0x62, 0xd2, 0xc1, + 0x51, 0xb5, 0x7b, 0xe3, 0x3a, 0xf6, 0x2c, 0x71, 0x13, 0x6c, 0x16, 0x0f, 0x2b, 0x71, 0xdb, 0x97, + 0xe8, 0x4d, 0x9f, 0xa1, 0xcf, 0xd1, 0xc7, 0xaa, 0x3c, 0xb6, 0xc1, 0x80, 0x97, 0xe6, 0xa2, 0x37, + 0xe0, 0x39, 0xdf, 0xf9, 0xbe, 0xef, 0xcc, 0x68, 0x66, 0xce, 0xc0, 0x0b, 0x37, 0x1c, 0x8f, 0x67, + 0x81, 0xcf, 0xe6, 0xb6, 0xe3, 0x8d, 0xfd, 0xc0, 0x9e, 0x4d, 0x3c, 0x87, 0xd1, 0xce, 0x64, 0x1a, + 0xb2, 0x10, 0x55, 0xf9, 0xdf, 0xed, 0xec, 0x43, 0xf3, 0x89, 0x7b, 0xe7, 0x30, 0xdb, 0xf7, 0x68, + 0xc0, 0x7c, 0x36, 0x4f, 0xe0, 0xe6, 0x41, 0x46, 0xf6, 0x69, 0x94, 0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09, 0x23, 0x9f, 0xf7, 0xab, 0x78, 0x06, 0x15, 0xb2, 0x18, 0xb7, + 0xff, 0x12, 0x40, 0xca, 0x35, 0xbc, 0xff, 0xae, 0xe1, 0x25, 0x40, 0xd6, 0x3e, 0xd3, 0x17, 0x88, + 0x48, 0xc4, 0x34, 0x62, 0x78, 0x2b, 0x5e, 0xa5, 0x55, 0x2f, 0xf4, 0x3d, 0xec, 0xa5, 0x89, 0xe9, + 0xab, 0xe2, 0x59, 0xd1, 0xab, 0xe2, 0xce, 0x61, 0x24, 0xcb, 0x3b, 0xaf, 0xbf, 0x97, 0x3a, 0x27, + 0x67, 0x59, 0xd6, 0xed, 0x2e, 0xff, 0x7a, 0xfd, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, 0xd0, + 0x35, 0x14, 0x87, 0x09, 0x00, 0x00, +} diff --git a/protocol/protobuf/community_admin_update.proto b/protocol/protobuf/community_admin_update.proto new file mode 100644 index 000000000..724ab292e --- /dev/null +++ b/protocol/protobuf/community_admin_update.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; + +option go_package = "./;protobuf"; +package protobuf; + +import "chat_identity.proto"; +import "communities.proto"; + +message CommunityAdminEvent { + uint64 clock = 1; + bytes community_id = 2; + EventType type = 3; + CommunityConfig community_config = 4; + map token_permissions = 5; + CategoryData category_data = 6; + ChannelData channel_data = 7; + string member_to_action = 8; + map membersAdded = 9; + map rejectedRequestsToJoin = 10; + map acceptedRequestsToJoin = 11; + + enum EventType { + UNKNOWN = 0; + COMMUNITY_EDIT = 1; + COMMUNITY_MEMBER_TOKEN_PERMISSION_CHANGE = 2; + COMMUNITY_MEMBER_TOKEN_PERMISSION_DELETE = 3; + COMMUNITY_CATEGORY_CREATE = 4; + COMMUNITY_CATEGORY_DELETE = 5; + COMMUNITY_CATEGORY_EDIT = 6; + COMMUNITY_CHANNEL_CREATE = 7; + COMMUNITY_CHANNEL_DELETE = 8; + COMMUNITY_CHANNEL_EDIT = 9; + COMMUNITY_CATEGORY_REORDER = 10; + COMMUNITY_CHANNEL_REORDER = 11; + COMMUNITY_REQUEST_TO_JOIN_ACCEPT = 12; + COMMUNITY_REQUEST_TO_JOIN_REJECT = 13; + COMMUNITY_MEMBER_KICK = 14; + COMMUNITY_MEMBER_BAN = 15; + COMMUNITY_MEMBER_UNBAN = 16; + } +} + +message CommunityConfig { + ChatIdentity identity = 1; + CommunityPermissions permissions = 2; + CommunityAdminSettings admin_settings = 3; + string intro_message = 4; + string outro_message = 5; + repeated string tags = 6; +} + +message CategoryData { + string category_id = 1; + string name = 2; + repeated string channels_ids = 3; + int32 position = 4; +} + +message ChannelData { + string category_id = 1; + string channel_id = 2; + int32 position = 3; + CommunityChat channel = 4; +} \ No newline at end of file diff --git a/protocol/protobuf/service.go b/protocol/protobuf/service.go index bfd5a4227..9d97048d2 100644 --- a/protocol/protobuf/service.go +++ b/protocol/protobuf/service.go @@ -4,7 +4,7 @@ import ( "github.com/golang/protobuf/proto" ) -//go:generate protoc --go_out=. ./chat_message.proto ./application_metadata_message.proto ./membership_update_message.proto ./command.proto ./contact.proto ./pairing.proto ./push_notifications.proto ./emoji_reaction.proto ./enums.proto ./group_chat_invitation.proto ./chat_identity.proto ./communities.proto ./pin_message.proto ./anon_metrics.proto ./status_update.proto ./sync_settings.proto ./contact_verification.proto +//go:generate protoc --go_out=. ./chat_message.proto ./application_metadata_message.proto ./membership_update_message.proto ./command.proto ./contact.proto ./pairing.proto ./push_notifications.proto ./emoji_reaction.proto ./enums.proto ./group_chat_invitation.proto ./chat_identity.proto ./communities.proto ./pin_message.proto ./anon_metrics.proto ./status_update.proto ./sync_settings.proto ./contact_verification.proto ./community_admin_update.proto func Unmarshal(payload []byte) (*ApplicationMetadataMessage, error) { var message ApplicationMetadataMessage diff --git a/protocol/pushnotificationclient/migrations/migrations.go b/protocol/pushnotificationclient/migrations/migrations.go index d875988e8..1123d9d9a 100644 --- a/protocol/pushnotificationclient/migrations/migrations.go +++ b/protocol/pushnotificationclient/migrations/migrations.go @@ -90,7 +90,7 @@ func _1593601729_initial_schemaDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1593601729_initial_schema.down.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1593601729_initial_schema.down.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa, 0x95, 0x55, 0x64, 0x38, 0x40, 0x16, 0xbf, 0x8b, 0x1c, 0x18, 0xb4, 0xc5, 0x7f, 0xd0, 0xb8, 0xf0, 0x3c, 0xa2, 0x82, 0xf8, 0x8d, 0x5a, 0xd3, 0xb6, 0x6e, 0xa3, 0xb4, 0xc, 0x9, 0x33, 0x0}} return a, nil } @@ -110,7 +110,7 @@ func _1593601729_initial_schemaUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1593601729_initial_schema.up.sql", size: 1773, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1593601729_initial_schema.up.sql", size: 1773, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4e, 0x1e, 0x5, 0x35, 0x9, 0xb2, 0x2d, 0x6f, 0x33, 0x63, 0xa2, 0x7a, 0x5b, 0xd2, 0x2d, 0xcb, 0x79, 0x7e, 0x6, 0xb4, 0x9d, 0x35, 0xd8, 0x9b, 0x55, 0xe5, 0xf8, 0x44, 0xca, 0xa6, 0xf3, 0xd3}} return a, nil } @@ -130,7 +130,7 @@ func _1597909626_add_server_typeDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1597909626_add_server_type.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1597909626_add_server_type.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -150,7 +150,7 @@ func _1597909626_add_server_typeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1597909626_add_server_type.up.sql", size: 145, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1597909626_add_server_type.up.sql", size: 145, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc8, 0x3f, 0xe0, 0xe7, 0x57, 0x0, 0x5d, 0x60, 0xf3, 0x55, 0x64, 0x71, 0x80, 0x3c, 0xca, 0x8, 0x61, 0xb5, 0x3c, 0xe, 0xa1, 0xe4, 0x61, 0xd1, 0x4e, 0xd8, 0xb2, 0x55, 0xdd, 0x87, 0x62, 0x9b}} return a, nil } @@ -170,7 +170,7 @@ func _1599053776_add_chat_id_and_typeDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.down.sql", size: 0, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} return a, nil } @@ -190,7 +190,7 @@ func _1599053776_add_chat_id_and_typeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.up.sql", size: 264, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.up.sql", size: 264, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x7a, 0xf9, 0xc4, 0xa2, 0x96, 0x2e, 0xf9, 0x8f, 0x7, 0xf1, 0x1e, 0x73, 0x8a, 0xa6, 0x3a, 0x13, 0x4, 0x73, 0x82, 0x83, 0xb, 0xe3, 0xb5, 0x3b, 0x7e, 0xd, 0x23, 0xce, 0x98, 0xd4, 0xdc}} return a, nil } @@ -210,7 +210,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc0, 0x2f, 0x1e, 0x64, 0x9, 0x93, 0xe4, 0x8b, 0xf2, 0x98, 0x5a, 0x45, 0xe2, 0x80, 0x88, 0x67, 0x7a, 0x2d, 0xd7, 0x4b, 0xd1, 0x73, 0xb6, 0x6d, 0x15, 0xc2, 0x0, 0x34, 0xcd, 0xa0, 0xdb, 0x20}} return a, nil } diff --git a/protocol/pushnotificationserver/migrations/migrations.go b/protocol/pushnotificationserver/migrations/migrations.go index 738d389f9..01dfd02c3 100644 --- a/protocol/pushnotificationserver/migrations/migrations.go +++ b/protocol/pushnotificationserver/migrations/migrations.go @@ -88,7 +88,7 @@ func _1593601728_initial_schemaDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1593601728_initial_schema.down.sql", size: 200, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1593601728_initial_schema.down.sql", size: 200, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x88, 0x8a, 0x61, 0x81, 0x57, 0x45, 0x9b, 0x97, 0x9b, 0x1f, 0xf6, 0x94, 0x8a, 0x20, 0xb3, 0x2b, 0xff, 0x69, 0x49, 0xf4, 0x58, 0xcc, 0xd0, 0x55, 0xcc, 0x9a, 0x8b, 0xb6, 0x7f, 0x29, 0x53, 0xc1}} return a, nil } @@ -108,7 +108,7 @@ func _1593601728_initial_schemaUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1593601728_initial_schema.up.sql", size: 675, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1593601728_initial_schema.up.sql", size: 675, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x61, 0x90, 0x79, 0xd9, 0x14, 0x65, 0xe9, 0x96, 0x53, 0x17, 0x33, 0x54, 0xeb, 0x8b, 0x5d, 0x95, 0x99, 0x10, 0x36, 0x58, 0xdd, 0xb2, 0xbf, 0x45, 0xd9, 0xbb, 0xc4, 0x92, 0xe, 0xce, 0x2}} return a, nil } @@ -128,7 +128,7 @@ func _1598419937_add_push_notifications_tableDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1598419937_add_push_notifications_table.down.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1598419937_add_push_notifications_table.down.sql", size: 51, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc, 0x98, 0xc8, 0x30, 0x45, 0x5b, 0xc5, 0x7d, 0x13, 0x5d, 0xe7, 0xc8, 0x23, 0x43, 0xf7, 0xdc, 0x9c, 0xe2, 0xdd, 0x63, 0xf0, 0xb7, 0x16, 0x40, 0xc, 0xda, 0xb9, 0x16, 0x70, 0x2b, 0x5a, 0x7e}} return a, nil } @@ -148,7 +148,7 @@ func _1598419937_add_push_notifications_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1598419937_add_push_notifications_table.up.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "1598419937_add_push_notifications_table.up.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2, 0x3e, 0xef, 0xf, 0xc2, 0xdf, 0xbc, 0x99, 0x7a, 0xc2, 0xd3, 0x64, 0x4f, 0x4c, 0x7e, 0xfc, 0x2e, 0x8c, 0xa7, 0x54, 0xd3, 0x4d, 0x25, 0x98, 0x41, 0xbc, 0xea, 0xd7, 0x2, 0xc1, 0xd0, 0x52}} return a, nil } @@ -168,7 +168,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0644), modTime: time.Unix(1607354881, 0)} + info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc0, 0x2f, 0x1e, 0x64, 0x9, 0x93, 0xe4, 0x8b, 0xf2, 0x98, 0x5a, 0x45, 0xe2, 0x80, 0x88, 0x67, 0x7a, 0x2d, 0xd7, 0x4b, 0xd1, 0x73, 0xb6, 0x6d, 0x15, 0xc2, 0x0, 0x34, 0xcd, 0xa0, 0xdb, 0x20}} return a, nil } diff --git a/protocol/requests/add_role_to_member.go b/protocol/requests/add_role_to_member.go index b5c568ded..5ca83d18e 100644 --- a/protocol/requests/add_role_to_member.go +++ b/protocol/requests/add_role_to_member.go @@ -26,7 +26,7 @@ func (a *AddRoleToMember) Validate() error { return ErrAddRoleToMemberInvalidUser } - if a.Role == protobuf.CommunityMember_UNKNOWN_ROLE { + if a.Role == protobuf.CommunityMember_ROLE_NONE { return ErrAddRoleToMemberInvalidRole } diff --git a/protocol/requests/remove_role_from_member.go b/protocol/requests/remove_role_from_member.go index ae1f104c3..ca8280dc6 100644 --- a/protocol/requests/remove_role_from_member.go +++ b/protocol/requests/remove_role_from_member.go @@ -26,7 +26,7 @@ func (r *RemoveRoleFromMember) Validate() error { return ErrRemoveRoleFromMemberInvalidUser } - if r.Role == protobuf.CommunityMember_UNKNOWN_ROLE { + if r.Role == protobuf.CommunityMember_ROLE_NONE { return ErrRemoveRoleFromMemberInvalidRole } diff --git a/protocol/transport/migrations/migrations.go b/protocol/transport/migrations/migrations.go index f625e6513..8d0398654 100644 --- a/protocol/transport/migrations/migrations.go +++ b/protocol/transport/migrations/migrations.go @@ -89,7 +89,7 @@ func _1561059284_add_waku_keysDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1561059284_add_waku_keys.down.sql", size: 22, mode: os.FileMode(0644), modTime: time.Unix(1619185887, 0)} + info := bindataFileInfo{name: "1561059284_add_waku_keys.down.sql", size: 22, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe5, 0x2a, 0x7e, 0x9, 0xa3, 0xdd, 0xc6, 0x3, 0xfa, 0xaa, 0x98, 0xa0, 0x26, 0x5e, 0x67, 0x43, 0xe6, 0x20, 0xfd, 0x10, 0xfd, 0x60, 0x89, 0x17, 0x13, 0x87, 0x1b, 0x44, 0x36, 0x79, 0xb6, 0x60}} return a, nil } @@ -109,7 +109,7 @@ func _1561059284_add_waku_keysUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1561059284_add_waku_keys.up.sql", size: 109, mode: os.FileMode(0644), modTime: time.Unix(1619185887, 0)} + info := bindataFileInfo{name: "1561059284_add_waku_keys.up.sql", size: 109, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0x5c, 0x8, 0x32, 0xef, 0x12, 0x88, 0x21, 0xd, 0x7a, 0x42, 0x4d, 0xe7, 0x2d, 0x6c, 0x99, 0xb6, 0x1, 0xf1, 0xba, 0x2c, 0x40, 0x8d, 0xa9, 0x4b, 0xe6, 0xc4, 0x21, 0xec, 0x47, 0x6b, 0xf7}} return a, nil } @@ -129,7 +129,7 @@ func _1616691080_add_wakuv2_keysDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1624017080, 0)} + info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x42, 0xb6, 0x23, 0x70, 0xb8, 0x63, 0x18, 0x61, 0xea, 0x35, 0x6e, 0xae, 0xe9, 0x71, 0x89, 0xa, 0xa5, 0x72, 0xa2, 0x64, 0xaa, 0x45, 0x1, 0xf, 0xfc, 0xee, 0x1b, 0xd9, 0xd2, 0x27, 0xf4, 0xe2}} return a, nil } @@ -149,7 +149,7 @@ func _1616691080_add_wakuv2_keysUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1624017080, 0)} + info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.up.sql", size: 111, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xf0, 0x97, 0x25, 0xfe, 0x96, 0x2c, 0xa8, 0x62, 0x4a, 0x71, 0x75, 0xff, 0x5f, 0x43, 0x1e, 0x71, 0x53, 0xf1, 0xde, 0xf, 0xcf, 0xcd, 0x87, 0x15, 0x61, 0x9d, 0x25, 0x2e, 0xaf, 0x18, 0x99}} return a, nil } @@ -169,7 +169,7 @@ func _1634723014_add_wakuv2_keysUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1634723014_add_wakuV2_keys.up.sql", size: 125, mode: os.FileMode(0644), modTime: time.Unix(1634809616, 0)} + info := bindataFileInfo{name: "1634723014_add_wakuV2_keys.up.sql", size: 125, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xe1, 0x7a, 0x1e, 0x6, 0xad, 0x1b, 0x37, 0xdb, 0xea, 0x94, 0xaf, 0xe0, 0x7d, 0xc9, 0xd6, 0xda, 0x52, 0x71, 0x8a, 0x44, 0xb3, 0xa6, 0x7b, 0x1e, 0x90, 0xdb, 0x1e, 0x5a, 0xa, 0x40, 0x26}} return a, nil } @@ -189,7 +189,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 373, mode: os.FileMode(0644), modTime: time.Unix(1619185887, 0)} + info := bindataFileInfo{name: "doc.go", size: 373, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x23, 0x6a, 0xc1, 0xce, 0x94, 0xf6, 0xef, 0xf1, 0x97, 0x95, 0xb, 0x35, 0xaf, 0x5f, 0xe7, 0x5f, 0xac, 0x6e, 0xb8, 0xab, 0xba, 0xb5, 0x35, 0x97, 0x22, 0x36, 0x11, 0xce, 0x44, 0xfc, 0xfa, 0xac}} return a, nil } diff --git a/protocol/v1/status_message.go b/protocol/v1/status_message.go index ac59b1dc7..3680c6d01 100644 --- a/protocol/v1/status_message.go +++ b/protocol/v1/status_message.go @@ -332,7 +332,10 @@ func (m *StatusMessage) HandleApplication() error { return m.unmarshalProtobufData(new(protobuf.SyncActivityCenterNotifications)) case protobuf.ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE: return m.unmarshalProtobufData(new(protobuf.SyncActivityCenterNotificationState)) + case protobuf.ApplicationMetadataMessage_COMMUNITY_ADMIN_MESSAGE: + return m.unmarshalProtobufData(new(protobuf.CommunityAdminEvent)) } + return nil } diff --git a/services/chat/api.go b/services/chat/api.go index 16266075f..a7eda355a 100644 --- a/services/chat/api.go +++ b/services/chat/api.go @@ -35,10 +35,8 @@ type PinnedMessages struct { } type Member struct { - // Community Roles - Roles []protobuf.CommunityMember_Roles `json:"roles,omitempty"` - // Admin indicates if the member is an admin of the group chat - Admin bool `json:"admin"` + // Community Role + Role protobuf.CommunityMember_Roles `json:"role,omitempty"` // Joined indicates if the member has joined the group chat Joined bool `json:"joined"` } @@ -88,7 +86,7 @@ type ChannelGroup struct { Chats map[string]*Chat `json:"chats"` Categories map[string]communities.CommunityCategory `json:"categories"` EnsName string `json:"ensName"` - Admin bool `json:"admin"` + MemberRole protobuf.CommunityMember_Roles `json:"memberRole"` Verified bool `json:"verified"` Description string `json:"description"` IntroMessage string `json:"introMessage"` @@ -169,7 +167,7 @@ func (api *API) getChannelGroups(ctx context.Context, channelGroupID string) (ma Chats: chats, Categories: make(map[string]communities.CommunityCategory), EnsName: "", // Not implemented yet in communities - Admin: true, + MemberRole: protobuf.CommunityMember_ROLE_OWNER, Verified: true, Description: "", IntroMessage: "", @@ -211,7 +209,7 @@ func (api *API) getChannelGroups(ctx context.Context, channelGroupID string) (ma Images: make(map[string]images.IdentityImage), Chats: make(map[string]*Chat), Categories: make(map[string]communities.CommunityCategory), - Admin: community.IsAdmin(), + MemberRole: community.MemberRole(community.MemberIdentity()), Verified: community.Verified(), Description: community.DescriptionText(), IntroMessage: community.IntroMessage(), @@ -385,7 +383,12 @@ func getChatMembers(sourceChat *protocol.Chat, community *communities.Community, if sourceChat.ChatType == protocol.ChatTypePrivateGroupChat && len(sourceChat.Members) > 0 { for _, m := range sourceChat.Members { result[m.ID] = Member{ - Admin: m.Admin, + Role: func() protobuf.CommunityMember_Roles { + if m.Admin { + return protobuf.CommunityMember_ROLE_OWNER + } + return protobuf.CommunityMember_ROLE_NONE + }(), Joined: true, } } @@ -404,17 +407,15 @@ func getChatMembers(sourceChat *protocol.Chat, community *communities.Community, } if community != nil { - for member, m := range community.Description().Members { + for member := range community.Description().Members { pubKey, err := common.HexToPubkey(member) if err != nil { return nil, err } result[member] = Member{ - Roles: m.Roles, + Role: community.MemberRole(pubKey), Joined: community.Joined(), - Admin: community.IsMemberAdmin(pubKey), } - } return result, nil } diff --git a/static/bindata.go b/static/bindata.go index 00a402239..049638be1 100644 --- a/static/bindata.go +++ b/static/bindata.go @@ -103,7 +103,7 @@ func emojisTxt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "emojis.txt", size: 28134, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "emojis.txt", size: 28134, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x28, 0xc, 0x22, 0x34, 0xa1, 0xeb, 0x8, 0x8d, 0xef, 0x38, 0x1b, 0xd8, 0xc2, 0x1a, 0x6d, 0xa2, 0x62, 0xad, 0x43, 0xfc, 0x1c, 0x38, 0xda, 0x8c, 0x3f, 0x34, 0xa, 0x8c, 0x6f, 0x5d, 0xd8}} return a, nil } @@ -123,7 +123,7 @@ func ConfigReadmeMd() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/README.md", size: 3031, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/README.md", size: 3031, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x15, 0x44, 0x2b, 0x13, 0x14, 0x34, 0xa, 0x66, 0x62, 0x1b, 0xc6, 0x4a, 0x2c, 0x7d, 0x4d, 0x89, 0xfb, 0xc9, 0x69, 0xe4, 0x18, 0x5f, 0x3, 0x98, 0x6d, 0x3c, 0x9e, 0xa8, 0xcd, 0x53, 0x5d, 0x75}} return a, nil } @@ -143,7 +143,7 @@ func ConfigCliAnonMetricNodeClientJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/anon-metric-node-client.json", size: 857, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/cli/anon-metric-node-client.json", size: 857, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x90, 0xdf, 0xcd, 0xc8, 0x92, 0x1d, 0x63, 0x5e, 0xe1, 0xf9, 0x7f, 0xed, 0xf2, 0x68, 0x6b, 0x20, 0xff, 0x1d, 0x3b, 0xc9, 0x7b, 0xb9, 0x6a, 0xba, 0xd3, 0xbd, 0xf7, 0x48, 0x7b, 0x5a, 0x52, 0x79}} return a, nil } @@ -163,7 +163,7 @@ func ConfigCliAnonMetricNodeServerJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/anon-metric-node-server.json", size: 696, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/cli/anon-metric-node-server.json", size: 696, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf0, 0x2f, 0x97, 0xab, 0x77, 0x61, 0x93, 0x9d, 0x1f, 0x33, 0x18, 0x72, 0xad, 0xce, 0xa3, 0x35, 0xa9, 0x44, 0xbf, 0x29, 0xa8, 0xea, 0x21, 0xb7, 0x22, 0x7f, 0x7d, 0x3a, 0x6b, 0x55, 0x3c, 0x66}} return a, nil } @@ -183,7 +183,7 @@ func ConfigCliFleetEthProdJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-eth.prod.json", size: 3619, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-eth.prod.json", size: 3619, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x92, 0x4f, 0x86, 0x8b, 0x6e, 0x2, 0x27, 0xa3, 0x37, 0x27, 0x74, 0x51, 0xf0, 0x97, 0x5b, 0x64, 0x8e, 0xbd, 0x29, 0xba, 0x75, 0x2d, 0x75, 0x78, 0x46, 0xb9, 0x56, 0x6, 0xb1, 0xf9, 0x85, 0xdd}} return a, nil } @@ -203,7 +203,7 @@ func ConfigCliFleetEthStagingJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-eth.staging.json", size: 2139, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-eth.staging.json", size: 2139, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb0, 0xac, 0xc9, 0x61, 0x97, 0x42, 0x0, 0x3a, 0xfc, 0x78, 0x11, 0xa1, 0xc7, 0x55, 0x71, 0x46, 0x72, 0x3e, 0x52, 0xb0, 0x89, 0x69, 0x7f, 0x8f, 0xf1, 0x26, 0x44, 0xc5, 0xfc, 0x20, 0x9f, 0xa1}} return a, nil } @@ -223,7 +223,7 @@ func ConfigCliFleetStatusProdJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-status.prod.json", size: 2338, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-status.prod.json", size: 2338, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x59, 0xea, 0x14, 0x57, 0xed, 0x60, 0x4d, 0xb6, 0x32, 0x7e, 0xd3, 0xbe, 0x1e, 0xc7, 0xfe, 0x42, 0xee, 0xfe, 0x10, 0xe4, 0x22, 0x64, 0xc1, 0xb9, 0xce, 0x34, 0xcd, 0xdd, 0xe3, 0x38, 0x43, 0xd3}} return a, nil } @@ -243,7 +243,7 @@ func ConfigCliFleetStatusTestJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-status.test.json", size: 1457, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-status.test.json", size: 1457, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0x9f, 0x8f, 0x25, 0x1f, 0x31, 0xbd, 0x72, 0x26, 0xb7, 0xd, 0x7e, 0xcb, 0xbb, 0x12, 0xef, 0x9f, 0x1a, 0x2e, 0xb, 0x96, 0x64, 0x7d, 0x52, 0x9e, 0x68, 0x13, 0x55, 0xd5, 0x88, 0x38, 0x7b}} return a, nil } @@ -263,7 +263,7 @@ func ConfigCliFleetWakuv2ProdJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.prod.json", size: 1264, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.prod.json", size: 1264, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xb9, 0x1c, 0x57, 0x50, 0xa9, 0x93, 0x70, 0xcd, 0xd7, 0x22, 0xee, 0x65, 0x72, 0x11, 0x71, 0xd3, 0x20, 0xd0, 0xf0, 0x4d, 0x53, 0x94, 0x44, 0x81, 0xbd, 0x11, 0xed, 0x5e, 0x72, 0x0, 0x12}} return a, nil } @@ -283,7 +283,7 @@ func ConfigCliFleetWakuv2TestJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.test.json", size: 1264, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} + info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.test.json", size: 1264, mode: os.FileMode(0644), modTime: time.Unix(1685534078, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2c, 0x67, 0x1e, 0xd1, 0x98, 0x7b, 0xf3, 0x9f, 0x76, 0xa0, 0xbe, 0x67, 0x29, 0xdb, 0xd7, 0x3e, 0xb8, 0x7c, 0x65, 0x2d, 0x2, 0x84, 0xe0, 0xab, 0x8d, 0x3d, 0x4a, 0x53, 0xb4, 0xa7, 0x2e, 0xf0}} return a, nil } @@ -303,7 +303,7 @@ func ConfigCliLesEnabledJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/les-enabled.json", size: 58, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/cli/les-enabled.json", size: 58, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xee, 0x27, 0xa7, 0x74, 0xa0, 0x46, 0xa1, 0x41, 0xed, 0x4d, 0x16, 0x5b, 0xf3, 0xf0, 0x7c, 0xc8, 0x2f, 0x6f, 0x47, 0xa4, 0xbb, 0x5f, 0x43, 0x33, 0xd, 0x9, 0x9d, 0xea, 0x9e, 0x15, 0xee}} return a, nil } @@ -323,7 +323,7 @@ func ConfigCliMailserverEnabledJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/cli/mailserver-enabled.json", size: 176, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/cli/mailserver-enabled.json", size: 176, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x34, 0xec, 0x81, 0x8b, 0x99, 0xb6, 0xdb, 0xc0, 0x8b, 0x46, 0x97, 0x96, 0xc7, 0x58, 0x30, 0x33, 0xef, 0x54, 0x25, 0x87, 0x7b, 0xb9, 0x94, 0x6b, 0x18, 0xa4, 0x5b, 0x58, 0x67, 0x7c, 0x44, 0xa6}} return a, nil } @@ -343,7 +343,7 @@ func ConfigStatusChainGenesisJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "../config/status-chain-genesis.json", size: 612, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "../config/status-chain-genesis.json", size: 612, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb, 0xf0, 0xc, 0x1, 0x95, 0x65, 0x6, 0x55, 0x48, 0x8f, 0x83, 0xa0, 0xb4, 0x81, 0xda, 0xad, 0x30, 0x6d, 0xb2, 0x78, 0x1b, 0x26, 0x4, 0x13, 0x12, 0x9, 0x6, 0xae, 0x3a, 0x2c, 0x1, 0x71}} return a, nil } @@ -363,7 +363,7 @@ func keysBootnodeKey() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/bootnode.key", size: 65, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/bootnode.key", size: 65, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x31, 0xcf, 0x27, 0xd4, 0x96, 0x2e, 0x32, 0xcd, 0x58, 0x96, 0x2a, 0xe5, 0x8c, 0xa0, 0xf1, 0x73, 0x1f, 0xd6, 0xd6, 0x8b, 0xb, 0x73, 0xd3, 0x2c, 0x84, 0x1a, 0x56, 0xa4, 0x74, 0xb6, 0x95, 0x20}} return a, nil } @@ -383,7 +383,7 @@ func keysFirebaseauthkey() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe, 0x69, 0x23, 0x64, 0x7d, 0xf9, 0x14, 0x37, 0x6f, 0x2b, 0x1, 0xf0, 0xb0, 0xa4, 0xb2, 0xd0, 0x18, 0xcd, 0xf9, 0xeb, 0x57, 0xa3, 0xfd, 0x79, 0x25, 0xa7, 0x9c, 0x3, 0xce, 0x26, 0xec, 0xe1}} return a, nil } @@ -403,7 +403,7 @@ func keysTestAccount1StatusChainPk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0xba, 0x35, 0x1, 0x2b, 0x9d, 0xad, 0xf0, 0x2d, 0x3c, 0x4d, 0x6, 0xb5, 0x22, 0x2, 0x47, 0xd4, 0x1c, 0xf4, 0x31, 0x2f, 0xb, 0x5b, 0x27, 0x5d, 0x43, 0x97, 0x58, 0x2d, 0xf0, 0xe1, 0xbe}} return a, nil } @@ -423,7 +423,7 @@ func keysTestAccount1Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0x43, 0xc2, 0xf4, 0x8c, 0xc6, 0x64, 0x25, 0x8c, 0x7, 0x8c, 0xa8, 0x89, 0x2b, 0x7b, 0x9b, 0x4f, 0x81, 0xcb, 0xce, 0x3d, 0xef, 0x82, 0x9c, 0x27, 0x27, 0xa9, 0xc5, 0x46, 0x70, 0x30, 0x38}} return a, nil } @@ -443,7 +443,7 @@ func keysTestAccount2StatusChainPk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0xf8, 0x5c, 0xe9, 0x92, 0x96, 0x2d, 0x88, 0x2b, 0x8e, 0x42, 0x3f, 0xa4, 0x93, 0x6c, 0xad, 0xe9, 0xc0, 0x1b, 0x8a, 0x8, 0x8c, 0x5e, 0x7a, 0x84, 0xa2, 0xf, 0x9f, 0x77, 0x58, 0x2c, 0x2c}} return a, nil } @@ -463,7 +463,7 @@ func keysTestAccount2Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x72, 0xd5, 0x95, 0x5c, 0x5a, 0x99, 0x9d, 0x2f, 0x21, 0x83, 0xd7, 0x10, 0x17, 0x4a, 0x3d, 0x65, 0xc9, 0x26, 0x1a, 0x2c, 0x9d, 0x65, 0x63, 0xd2, 0xa0, 0xfc, 0x7c, 0x0, 0x87, 0x38, 0x9f}} return a, nil } @@ -483,7 +483,7 @@ func keysTestAccount3BeforeEip55Pk() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x40, 0x56, 0xc1, 0x5e, 0x10, 0x6e, 0x28, 0x15, 0x3, 0x4e, 0xc4, 0xc4, 0x71, 0x4d, 0x16, 0x99, 0xcc, 0x1b, 0x63, 0xee, 0x10, 0x20, 0xe4, 0x59, 0x52, 0x3f, 0xc0, 0xad, 0x15, 0x13, 0x72}} return a, nil } diff --git a/t/bindata.go b/t/bindata.go index d3635e1b9..911fda65c 100644 --- a/t/bindata.go +++ b/t/bindata.go @@ -86,7 +86,7 @@ func configPublicChainAccountsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 307, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 307, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x76, 0x5d, 0xc0, 0xfe, 0x57, 0x50, 0x18, 0xec, 0x2d, 0x61, 0x1b, 0xa9, 0x81, 0x11, 0x5f, 0x77, 0xf7, 0xb6, 0x67, 0x82, 0x1, 0x40, 0x68, 0x9d, 0xc5, 0x41, 0xaf, 0xce, 0x43, 0x81, 0x92, 0x96}} return a, nil } @@ -106,7 +106,7 @@ func configStatusChainAccountsJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 543, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 543, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xb3, 0x61, 0x51, 0x70, 0x3c, 0x12, 0x3e, 0xf1, 0x1c, 0x81, 0xfb, 0x9a, 0x7c, 0xe3, 0x63, 0xd0, 0x8f, 0x12, 0xc5, 0x2d, 0xf4, 0xea, 0x27, 0x33, 0xef, 0xca, 0xf9, 0x3f, 0x72, 0x44, 0xbf}} return a, nil } @@ -126,7 +126,7 @@ func configTestDataJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} + info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1684179677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xce, 0x9d, 0x80, 0xf5, 0x87, 0xfa, 0x57, 0x1d, 0xa1, 0xd5, 0x7a, 0x10, 0x3, 0xac, 0xd7, 0xf4, 0x64, 0x32, 0x96, 0x2b, 0xb7, 0x21, 0xb7, 0xa6, 0x80, 0x40, 0xe9, 0x65, 0xe3, 0xd6, 0xbd, 0x40}} return a, nil }