diff --git a/src/Error.cpp b/src/Error.cpp index 452f653..78c5ee5 100644 --- a/src/Error.cpp +++ b/src/Error.cpp @@ -146,13 +146,14 @@ const std::vector ts::avariableErrors = { {0x2200, "conversation_invalid_id" , "invalid conversation id" }, {0x2201, "conversation_more_data" , "there are more messages to send" }, + {0x2202, "conversation_is_private" , "the target conversation is private" }, {0x1200, "query_not_exists" , "query account does not exists" }, {0x1201, "query_already_exists" , "query account already exists" }, {0x1202, "query_too_many_simultaneously_sessions", "too many simultaneously connected sessions" }, {0x1203, "query_maxclients_reached" , "query server reached its limit" }, - {0xE000, "resource_limit_reached" , "resource limit reached" }, + {0xE000, "resource_limit_reached" , "resource limit reached" }, {0xFFFF, "custom_error" , "costume" }, }; diff --git a/src/PermissionManager.cpp b/src/PermissionManager.cpp index 4440316..c078f2d 100644 --- a/src/PermissionManager.cpp +++ b/src/PermissionManager.cpp @@ -124,6 +124,7 @@ deque> ts::permission::availablePermissions make_shared(PermissionType::i_channel_create_modify_with_temp_delete_delay, PermissionGroup::channel_create, "i_channel_create_modify_with_temp_delete_delay", "Max delete delay for temporary channels"), make_shared(PermissionType::i_channel_create_modify_conversation_history_length, PermissionGroup::channel_create, "i_channel_create_modify_conversation_history_length", "Upper limmit for the setting of the max conversation history limit"), make_shared(PermissionType::b_channel_create_modify_conversation_history_unlimited, PermissionGroup::channel_create, "b_channel_create_modify_conversation_history_unlimited", "Allows the user to set the channel conversation history to unlimited"), + make_shared(PermissionType::b_channel_create_modify_conversation_private, PermissionGroup::channel_create, "b_channel_create_modify_conversation_private", "Allows the user to set the channel conversation to private"), make_shared(PermissionType::b_channel_modify_parent, PermissionGroup::channel_modify, "b_channel_modify_parent", "Move channels"), make_shared(PermissionType::b_channel_modify_make_default, PermissionGroup::channel_modify, "b_channel_modify_make_default", "Make channel default"), make_shared(PermissionType::b_channel_modify_make_permanent, PermissionGroup::channel_modify, "b_channel_modify_make_permanent", "Make channel permanent"), @@ -144,6 +145,8 @@ deque> ts::permission::availablePermissions make_shared(PermissionType::i_channel_needed_modify_power, PermissionGroup::channel_modify, "i_channel_needed_modify_power", "Needed channel modify power"), make_shared(PermissionType::b_channel_modify_make_codec_encrypted, PermissionGroup::channel_modify, "b_channel_modify_make_codec_encrypted", "Make channel codec encrypted"), make_shared(PermissionType::b_channel_modify_temp_delete_delay, PermissionGroup::channel_modify, "b_channel_modify_temp_delete_delay", "Modify temporary channel delete delay"), + make_shared(PermissionType::b_channel_conversation_message_delete, PermissionGroup::channel_modify, "b_channel_conversation_message_delete", "If set the user is able to delete conversation messages"), + make_shared(PermissionType::b_channel_delete_permanent, PermissionGroup::channel_delete, "b_channel_delete_permanent", "Delete permanent channels"), make_shared(PermissionType::b_channel_delete_semi_permanent, PermissionGroup::channel_delete, "b_channel_delete_semi_permanent", "Delete semi-permanent channels"), make_shared(PermissionType::b_channel_delete_temporary, PermissionGroup::channel_delete, "b_channel_delete_temporary", "Delete temporary channels"), @@ -466,6 +469,9 @@ i_group_modify_power, b_virtualserver_modify_priority_speaker_dimm_modificator, b_virtualserver_modify_music_bot_limit, b_virtualserver_modify_default_messages, + i_channel_create_modify_conversation_history_length, + b_channel_create_modify_conversation_history_unlimited, + b_channel_create_modify_conversation_private, b_channel_modify_name, b_channel_modify_password, b_channel_modify_topic, @@ -534,6 +540,7 @@ i_group_modify_power, b_client_offline_textmessage_send, b_virtualserver_client_dblist, b_virtualserver_modify_reserved_slots, + b_channel_conversation_message_delete, i_channel_create_modify_with_codec_latency_factor_min, b_channel_modify_codec_latency_factor, b_channel_modify_make_codec_encrypted, diff --git a/src/PermissionManager.h b/src/PermissionManager.h index 9510c1d..8e27768 100644 --- a/src/PermissionManager.h +++ b/src/PermissionManager.h @@ -174,6 +174,7 @@ namespace ts { i_channel_create_modify_with_temp_delete_delay, i_channel_create_modify_conversation_history_length, b_channel_create_modify_conversation_history_unlimited, + b_channel_create_modify_conversation_private, /* channel::modify */ b_channel_modify_parent, @@ -196,6 +197,7 @@ namespace ts { i_channel_needed_modify_power, b_channel_modify_make_codec_encrypted, b_channel_modify_temp_delete_delay, + b_channel_conversation_message_delete, /* channel::delete */ b_channel_delete_permanent, @@ -482,7 +484,7 @@ namespace ts { channel = i_channel_needed_permission_modify_power, channel_info = b_virtualserver_channel_permission_list, - channel_create = i_channel_create_modify_with_temp_delete_delay, + channel_create = b_channel_create_modify_conversation_private, channel_modify = b_channel_modify_temp_delete_delay, channel_delete = i_channel_needed_delete_power, channel_access = b_channel_ignore_description_view_power, diff --git a/src/Properties.cpp b/src/Properties.cpp index 25aa317..a1f789e 100644 --- a/src/Properties.cpp +++ b/src/Properties.cpp @@ -271,7 +271,8 @@ namespace ts { make_shared(CHANNEL_LAST_LEFT, "CHANNEL_LAST_LEFT", "0", TYPE_UNSIGNED_NUMBER, FLAG_SAVE | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW), //Available for all channels that are "in view", always up-to-date make_shared(CHANNEL_CREATED_AT, "CHANNEL_CREATED_AT", "0", TYPE_UNSIGNED_NUMBER, FLAG_SS | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW), //Available for all channels that are "in view", always up-to-date make_shared(CHANNEL_CREATED_BY, "CHANNEL_CREATED_BY", "0", TYPE_UNSIGNED_NUMBER, FLAG_SS | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW), //Available for all channels that are "in view", always up-to-date - make_shared(CHANNEL_CONVERSATION_HISTORY_LENGTH, "CHANNEL_CONVERSATION_HISTORY_LENGTH", "1500", TYPE_SIGNED_NUMBER, FLAG_SS | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW | FLAG_USER_EDITABLE) + make_shared(CHANNEL_CONVERSATION_HISTORY_LENGTH, "CHANNEL_CONVERSATION_HISTORY_LENGTH", "1500", TYPE_SIGNED_NUMBER, FLAG_SS | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW | FLAG_USER_EDITABLE), + make_shared(CHANNEL_FLAG_CONVERSATION_PRIVATE, "CHANNEL_FLAG_CONVERSATION_PRIVATE", "0", TYPE_BOOL, FLAG_SS | FLAG_CHANNEL_VIEW | FLAG_CHANNEL_VARIABLE | FLAG_NEW | FLAG_USER_EDITABLE) }; array, GroupProperties::GROUP_ENDMARKER> group_info = { @@ -347,8 +348,10 @@ namespace ts { make_shared(CLIENT_INTEGRATIONS, "CLIENT_INTEGRATIONS", "", TYPE_STRING, FLAG_CLIENT_VIEW | FLAG_USER_EDITABLE), //automatically up-to-date for any manager "in view", stores icons for partner badges make_shared(CLIENT_ACTIVE_INTEGRATIONS_INFO, "CLIENT_ACTIVE_INTEGRATIONS_INFO", "", TYPE_STRING, FLAG_INTERNAL | FLAG_USER_EDITABLE), - make_shared(CLIENT_TEAFORO_ID, "CLIENT_TEAFORO_ID", "0", TYPE_UNSIGNED_NUMBER, FLAG_NEW | FLAG_CLIENT_VIEW), - make_shared(CLIENT_TEAFORO_NAME, "CLIENT_TEAFORO_NAME", "", TYPE_STRING, FLAG_NEW | FLAG_CLIENT_VIEW), + //Using FLAG_GLOBAL here,lse they will be overridden on clientinit + make_shared(CLIENT_TEAFORO_ID, "CLIENT_TEAFORO_ID", "0", TYPE_UNSIGNED_NUMBER, FLAG_NEW | FLAG_CLIENT_VIEW | FLAG_GLOBAL), + make_shared(CLIENT_TEAFORO_NAME, "CLIENT_TEAFORO_NAME", "", TYPE_STRING, FLAG_NEW | FLAG_CLIENT_VIEW | FLAG_GLOBAL), + make_shared(CLIENT_TEAFORO_FLAGS, "CLIENT_TEAFORO_FLAGS", "0", TYPE_UNSIGNED_NUMBER, FLAG_NEW | FLAG_CLIENT_VIEW | FLAG_GLOBAL), //Music bot stuff make_shared(CLIENT_OWNER, "CLIENT_OWNER", "0", TYPE_UNSIGNED_NUMBER, FLAG_NEW | FLAG_CLIENT_VIEW), diff --git a/src/Properties.h b/src/Properties.h index 1ddcfe4..6b2298f 100644 --- a/src/Properties.h +++ b/src/Properties.h @@ -86,6 +86,8 @@ namespace ts { SERVERINSTANCE_UNDEFINED, SERVERINSTANCE_BEGINMARKER, SERVERINSTANCE_DATABASE_VERSION = SERVERINSTANCE_BEGINMARKER, + SERVERINSTANCE_PERMISSIONS_VERSION, + SERVERINSTANCE_FILETRANSFER_HOST, SERVERINSTANCE_FILETRANSFER_PORT, SERVERINSTANCE_FILETRANSFER_MAX_CONNECTIONS, @@ -109,7 +111,6 @@ namespace ts { SERVERINSTANCE_TEMPLATE_MUSICDEFAULT_GROUP, SERVERINSTANCE_GUEST_SERVERQUERY_GROUP, SERVERINSTANCE_ADMIN_SERVERQUERY_GROUP, - SERVERINSTANCE_PERMISSIONS_VERSION, SERVERINSTANCE_PENDING_CONNECTIONS_PER_IP, SERVERINSTANCE_SPOKEN_TIME_TOTAL, SERVERINSTANCE_SPOKEN_TIME_DELETED, @@ -262,6 +263,7 @@ namespace ts { CHANNEL_CREATED_BY, CHANNEL_CONVERSATION_HISTORY_LENGTH, + CHANNEL_FLAG_CONVERSATION_PRIVATE, CHANNEL_ENDMARKER }; @@ -356,6 +358,7 @@ namespace ts { CLIENT_TEAFORO_ID, CLIENT_TEAFORO_NAME, + CLIENT_TEAFORO_FLAGS, CLIENT_ENDMARKER }; @@ -419,6 +422,7 @@ namespace ts { //Rare properties CONNECTION_FILETRANSFER_BANDWIDTH_SENT, //how many bytes per second are currently being sent by file transfers CONNECTION_FILETRANSFER_BANDWIDTH_RECEIVED, //how many bytes per second are currently being received by file transfers + CONNECTION_FILETRANSFER_BYTES_RECEIVED_TOTAL, //how many bytes we received in total through file transfers CONNECTION_FILETRANSFER_BYTES_SENT_TOTAL, //how many bytes we sent in total through file transfers