adding channel support

This commit is contained in:
or-else
2020-07-20 12:20:38 -07:00
parent 331dea37cf
commit 0f095ceeca
16 changed files with 111 additions and 46 deletions
+3 -2
View File
@@ -21,7 +21,7 @@
"label_sdk": "SDK:", "label_sdk": "SDK:",
"label_server_address": "Server Adresse:", "label_server_address": "Server Adresse:",
"archived_contacts": "Archivierte Kontakte ({count})", "archived_contacts": "Archivierte Kontakte ({count})",
"contacts_not_found": "Sie haben keine Unterhaltungen\n\n¯\\_(ツ)_/¯", "contacts_not_found": "Sie haben keine Unterhaltungen<br />¯∖_(ツ)_/¯",
"full_name_prompt": "Vollständiger Name, z.B. Lisa Musterfrau", "full_name_prompt": "Vollständiger Name, z.B. Lisa Musterfrau",
"email_prompt": "E-Mail, z.B. jdoe@beispiel.de", "email_prompt": "E-Mail, z.B. jdoe@beispiel.de",
"button_sign_up": "Anmelden", "button_sign_up": "Anmelden",
@@ -170,5 +170,6 @@
"cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.", "cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.",
"tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.", "tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.",
"tags_editor_no_tags": "Schlagworte hinzufügen", "tags_editor_no_tags": "Schlagworte hinzufügen",
"title_manage_tags": "Verwalten" "title_manage_tags": "Verwalten",
"channel_prompt": "Dies ist ein Kanal"
} }
+1
View File
@@ -150,6 +150,7 @@
"group_user_id_prompt": "Group or User ID", "group_user_id_prompt": "Group or User ID",
"button_subscribe": "Subscribe", "button_subscribe": "Subscribe",
"topic_name_editing_placeholder": "Freeform name of the group", "topic_name_editing_placeholder": "Freeform name of the group",
"channel_prompt": "This is a channel",
"button_create": "Create", "button_create": "Create",
"permission_join": "Join ({val})", "permission_join": "Join ({val})",
"permission_read": "Read ({val})", "permission_read": "Read ({val})",
+2 -1
View File
@@ -170,5 +170,6 @@
"cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.", "cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.",
"tags_not_found": "No hay etiquetas definidas. Añade unas.", "tags_not_found": "No hay etiquetas definidas. Añade unas.",
"tags_editor_no_tags": "Añadir etiquetas", "tags_editor_no_tags": "Añadir etiquetas",
"title_manage_tags": "Gestionar" "title_manage_tags": "Gestionar",
"channel_prompt": "Este es un canal"
} }
+4 -3
View File
@@ -171,7 +171,8 @@
"tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.", "tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.",
"tags_editor_no_tags": "일부태그추가", "tags_editor_no_tags": "일부태그추가",
"title_manage_tags": "관리", "title_manage_tags": "관리",
"granted_permissions": ":!![MISSING]!!:Granted", "granted_permissions": "승낙하다",
"messages_not_readable": ":!![MISSING]!!:no access to messages", "messages_not_readable": "메시지에 액세스 할 수 없습니다",
"deleted_content": ":!![MISSING]!!:content deleted" "deleted_content": "내용이 삭제되었습니다",
"channel_prompt": "이 채널입니다"
} }
+2 -1
View File
@@ -170,5 +170,6 @@
"push_init_failed": "Ошибка инициализации пуш уведомлений", "push_init_failed": "Ошибка инициализации пуш уведомлений",
"invalid_security_token": "Токен некорректен", "invalid_security_token": "Токен некорректен",
"no_connection": "Нет связи", "no_connection": "Нет связи",
"code_doesnot_match": "Код не совпадает" "code_doesnot_match": "Код не совпадает",
"channel_prompt": "Создать канал"
} }
+2 -1
View File
@@ -170,5 +170,6 @@
"push_init_failed": "初始化推送通知失败", "push_init_failed": "初始化推送通知失败",
"invalid_security_token": "无效的安全令牌", "invalid_security_token": "无效的安全令牌",
"no_connection": "无连接", "no_connection": "无连接",
"code_doesnot_match": "代码不匹配" "code_doesnot_match": "代码不匹配",
"channel_prompt": "这是一个频道"
} }
+15 -6
View File
@@ -22,7 +22,7 @@
"label_sdk": "SDK:", "label_sdk": "SDK:",
"label_server_address": "Server Adresse:", "label_server_address": "Server Adresse:",
"archived_contacts": "Archivierte Kontakte ({count})", "archived_contacts": "Archivierte Kontakte ({count})",
"contacts_not_found": "Sie haben keine Unterhaltungen\n\n¯\\_(ツ)_/¯", "contacts_not_found": "Sie haben keine Unterhaltungen<br />¯∖_(ツ)_/¯",
"full_name_prompt": "Vollständiger Name, z.B. Lisa Musterfrau", "full_name_prompt": "Vollständiger Name, z.B. Lisa Musterfrau",
"email_prompt": "E-Mail, z.B. jdoe@beispiel.de", "email_prompt": "E-Mail, z.B. jdoe@beispiel.de",
"button_sign_up": "Anmelden", "button_sign_up": "Anmelden",
@@ -171,7 +171,8 @@
"cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.", "cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.",
"tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.", "tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.",
"tags_editor_no_tags": "Schlagworte hinzufügen", "tags_editor_no_tags": "Schlagworte hinzufügen",
"title_manage_tags": "Verwalten" "title_manage_tags": "Verwalten",
"channel_prompt": "Dies ist ein Kanal"
}, },
"en": { "en": {
"validate_credential_action": "confirm", "validate_credential_action": "confirm",
@@ -325,6 +326,7 @@
"group_user_id_prompt": "Group or User ID", "group_user_id_prompt": "Group or User ID",
"button_subscribe": "Subscribe", "button_subscribe": "Subscribe",
"topic_name_editing_placeholder": "Freeform name of the group", "topic_name_editing_placeholder": "Freeform name of the group",
"channel_prompt": "This is a channel",
"button_create": "Create", "button_create": "Create",
"permission_join": "Join ({val})", "permission_join": "Join ({val})",
"permission_read": "Read ({val})", "permission_read": "Read ({val})",
@@ -519,7 +521,8 @@
"cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.", "cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.",
"tags_not_found": "No hay etiquetas definidas. Añade unas.", "tags_not_found": "No hay etiquetas definidas. Añade unas.",
"tags_editor_no_tags": "Añadir etiquetas", "tags_editor_no_tags": "Añadir etiquetas",
"title_manage_tags": "Gestionar" "title_manage_tags": "Gestionar",
"channel_prompt": "Este es un canal"
}, },
"ko": { "ko": {
"validate_credential_action": "확인", "validate_credential_action": "확인",
@@ -690,7 +693,11 @@
"cannot_initiate_file_upload": "파일업로드를시작할수없습니다.", "cannot_initiate_file_upload": "파일업로드를시작할수없습니다.",
"tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.", "tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.",
"tags_editor_no_tags": "일부태그추가", "tags_editor_no_tags": "일부태그추가",
"title_manage_tags": "관리" "title_manage_tags": "관리",
"granted_permissions": "승낙하다",
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
"deleted_content": "내용이 삭제되었습니다",
"channel_prompt": "이 채널입니다"
}, },
"ru": { "ru": {
"contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯", "contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯",
@@ -864,7 +871,8 @@
"push_init_failed": "Ошибка инициализации пуш уведомлений", "push_init_failed": "Ошибка инициализации пуш уведомлений",
"invalid_security_token": "Токен некорректен", "invalid_security_token": "Токен некорректен",
"no_connection": "Нет связи", "no_connection": "Нет связи",
"code_doesnot_match": "Код не совпадает" "code_doesnot_match": "Код не совпадает",
"channel_prompt": "Создать канал"
}, },
"zh": { "zh": {
"archived_contacts": "已归档联系人 ({count})", "archived_contacts": "已归档联系人 ({count})",
@@ -1038,6 +1046,7 @@
"push_init_failed": "初始化推送通知失败", "push_init_failed": "初始化推送通知失败",
"invalid_security_token": "无效的安全令牌", "invalid_security_token": "无效的安全令牌",
"no_connection": "无连接", "no_connection": "无连接",
"code_doesnot_match": "代码不匹配" "code_doesnot_match": "代码不匹配",
"channel_prompt": "这是一个频道"
} }
} }
+2 -2
View File
@@ -63,9 +63,9 @@ class NewTopicView extends React.Component {
} }
} }
handleNewGroupSubmit(name, dataUrl, priv, tags) { handleNewGroupSubmit(name, dataUrl, priv, tags, isChannel) {
HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab')); HashNavigation.navigateTo(HashNavigation.removeUrlParam(window.location.hash, 'tab'));
this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags); this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags, isChannel);
} }
handleGroupByID(topicName) { handleGroupByID(topicName) {
+2 -2
View File
@@ -1061,9 +1061,9 @@ class TinodeWeb extends React.Component {
} }
// Request to start a new topic. New P2P topic requires peer's name. // Request to start a new topic. New P2P topic requires peer's name.
handleNewTopicRequest(peerName, pub, priv, tags) { handleNewTopicRequest(peerName, pub, priv, tags, isChannel) {
const topicName = peerName || this.tinode.newGroupTopicName(); const topicName = peerName || this.tinode.newGroupTopicName(isChannel);
const params = { const params = {
_topicName: topicName, _topicName: topicName,
}; };
+15 -3
View File
@@ -2,6 +2,7 @@ import React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';
import AvatarUpload from './avatar-upload.jsx'; import AvatarUpload from './avatar-upload.jsx';
import CheckBox from './checkbox.jsx';
import TagManager from './tag-manager.jsx'; import TagManager from './tag-manager.jsx';
import { MAX_TITLE_LENGTH } from '../config.js'; import { MAX_TITLE_LENGTH } from '../config.js';
@@ -14,14 +15,15 @@ export default class NewTopicGroup extends React.PureComponent {
fn: '', // full/formatted name fn: '', // full/formatted name
private: '', private: '',
imageDataUrl: null, imageDataUrl: null,
tags: [] tags: [],
isChannel: false
}; };
this.handleFnChange = this.handleFnChange.bind(this); this.handleFnChange = this.handleFnChange.bind(this);
this.handlePrivateChange = this.handlePrivateChange.bind(this); this.handlePrivateChange = this.handlePrivateChange.bind(this);
this.handleImageChanged = this.handleImageChanged.bind(this); this.handleImageChanged = this.handleImageChanged.bind(this);
this.handleTagsChanged = this.handleTagsChanged.bind(this); this.handleTagsChanged = this.handleTagsChanged.bind(this);
this.handleTagsChanged = this.handleTagsChanged.bind(this); this.handleChannelToggle = this.handleChannelToggle.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
} }
@@ -41,13 +43,17 @@ export default class NewTopicGroup extends React.PureComponent {
this.setState({tags: tags}); this.setState({tags: tags});
} }
handleChannelToggle() {
this.setState({isChannel: !this.state.isChannel});
}
handleSubmit(e) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
const fn = this.state.fn.trim().substring(0, MAX_TITLE_LENGTH); const fn = this.state.fn.trim().substring(0, MAX_TITLE_LENGTH);
const comment = this.state.private.trim().substring(0, MAX_TITLE_LENGTH); const comment = this.state.private.trim().substring(0, MAX_TITLE_LENGTH);
if (fn) { if (fn) {
this.props.onSubmit(fn, this.state.imageDataUrl, comment, this.state.tags); this.props.onSubmit(fn, this.state.imageDataUrl, comment, this.state.tags, this.state.isChannel);
} }
} }
@@ -81,6 +87,12 @@ export default class NewTopicGroup extends React.PureComponent {
onError={this.props.onError} onError={this.props.onError}
onImageChanged={this.handleImageChanged} /> onImageChanged={this.handleImageChanged} />
</div> </div>
<div className="panel-form-row">
<CheckBox checked={this.state.isChannel} onChange={this.handleChannelToggle}/>&nbsp;
<label onClick={this.handleChannelToggle}><FormattedMessage id="channel_prompt"
defaultMessage="This is a channel"
description="Checkbox label when creating a channel" /></label>
</div>
<FormattedMessage id="title_tag_manager">{ <FormattedMessage id="title_tag_manager">{
(title) => <TagManager (title) => <TagManager
tags={this.state.tags} tags={this.state.tags}
+33 -14
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+26 -7
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long