adding channel support
This commit is contained in:
+3
-2
@@ -21,7 +21,7 @@
|
||||
"label_sdk": "SDK:",
|
||||
"label_server_address": "Server Adresse:",
|
||||
"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",
|
||||
"email_prompt": "E-Mail, z.B. jdoe@beispiel.de",
|
||||
"button_sign_up": "Anmelden",
|
||||
@@ -170,5 +170,6 @@
|
||||
"cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.",
|
||||
"tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.",
|
||||
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
||||
"title_manage_tags": "Verwalten"
|
||||
"title_manage_tags": "Verwalten",
|
||||
"channel_prompt": "Dies ist ein Kanal"
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@
|
||||
"group_user_id_prompt": "Group or User ID",
|
||||
"button_subscribe": "Subscribe",
|
||||
"topic_name_editing_placeholder": "Freeform name of the group",
|
||||
"channel_prompt": "This is a channel",
|
||||
"button_create": "Create",
|
||||
"permission_join": "Join ({val})",
|
||||
"permission_read": "Read ({val})",
|
||||
|
||||
+2
-1
@@ -170,5 +170,6 @@
|
||||
"cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.",
|
||||
"tags_not_found": "No hay etiquetas definidas. Añade unas.",
|
||||
"tags_editor_no_tags": "Añadir etiquetas",
|
||||
"title_manage_tags": "Gestionar"
|
||||
"title_manage_tags": "Gestionar",
|
||||
"channel_prompt": "Este es un canal"
|
||||
}
|
||||
|
||||
+4
-3
@@ -171,7 +171,8 @@
|
||||
"tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.",
|
||||
"tags_editor_no_tags": "일부태그추가",
|
||||
"title_manage_tags": "관리",
|
||||
"granted_permissions": ":!![MISSING]!!:Granted",
|
||||
"messages_not_readable": ":!![MISSING]!!:no access to messages",
|
||||
"deleted_content": ":!![MISSING]!!:content deleted"
|
||||
"granted_permissions": "승낙하다",
|
||||
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
||||
"deleted_content": "내용이 삭제되었습니다",
|
||||
"channel_prompt": "이 채널입니다"
|
||||
}
|
||||
|
||||
+2
-1
@@ -170,5 +170,6 @@
|
||||
"push_init_failed": "Ошибка инициализации пуш уведомлений",
|
||||
"invalid_security_token": "Токен некорректен",
|
||||
"no_connection": "Нет связи",
|
||||
"code_doesnot_match": "Код не совпадает"
|
||||
"code_doesnot_match": "Код не совпадает",
|
||||
"channel_prompt": "Создать канал"
|
||||
}
|
||||
|
||||
+2
-1
@@ -170,5 +170,6 @@
|
||||
"push_init_failed": "初始化推送通知失败",
|
||||
"invalid_security_token": "无效的安全令牌",
|
||||
"no_connection": "无连接",
|
||||
"code_doesnot_match": "代码不匹配"
|
||||
"code_doesnot_match": "代码不匹配",
|
||||
"channel_prompt": "这是一个频道"
|
||||
}
|
||||
|
||||
+15
-6
@@ -22,7 +22,7 @@
|
||||
"label_sdk": "SDK:",
|
||||
"label_server_address": "Server Adresse:",
|
||||
"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",
|
||||
"email_prompt": "E-Mail, z.B. jdoe@beispiel.de",
|
||||
"button_sign_up": "Anmelden",
|
||||
@@ -171,7 +171,8 @@
|
||||
"cannot_initiate_file_upload": "Datei kann nicht hochgeladen werden.",
|
||||
"tags_not_found": "Keine Schlagworte definiert. Erstellen Sie welche.",
|
||||
"tags_editor_no_tags": "Schlagworte hinzufügen",
|
||||
"title_manage_tags": "Verwalten"
|
||||
"title_manage_tags": "Verwalten",
|
||||
"channel_prompt": "Dies ist ein Kanal"
|
||||
},
|
||||
"en": {
|
||||
"validate_credential_action": "confirm",
|
||||
@@ -325,6 +326,7 @@
|
||||
"group_user_id_prompt": "Group or User ID",
|
||||
"button_subscribe": "Subscribe",
|
||||
"topic_name_editing_placeholder": "Freeform name of the group",
|
||||
"channel_prompt": "This is a channel",
|
||||
"button_create": "Create",
|
||||
"permission_join": "Join ({val})",
|
||||
"permission_read": "Read ({val})",
|
||||
@@ -519,7 +521,8 @@
|
||||
"cannot_initiate_file_upload": "No se pudo iniciar la carga del archivo.",
|
||||
"tags_not_found": "No hay etiquetas definidas. Añade unas.",
|
||||
"tags_editor_no_tags": "Añadir etiquetas",
|
||||
"title_manage_tags": "Gestionar"
|
||||
"title_manage_tags": "Gestionar",
|
||||
"channel_prompt": "Este es un canal"
|
||||
},
|
||||
"ko": {
|
||||
"validate_credential_action": "확인",
|
||||
@@ -690,7 +693,11 @@
|
||||
"cannot_initiate_file_upload": "파일업로드를시작할수없습니다.",
|
||||
"tags_not_found": "태그가정의되지않았습니다.일부를추가하십시오.",
|
||||
"tags_editor_no_tags": "일부태그추가",
|
||||
"title_manage_tags": "관리"
|
||||
"title_manage_tags": "관리",
|
||||
"granted_permissions": "승낙하다",
|
||||
"messages_not_readable": "메시지에 액세스 할 수 없습니다",
|
||||
"deleted_content": "내용이 삭제되었습니다",
|
||||
"channel_prompt": "이 채널입니다"
|
||||
},
|
||||
"ru": {
|
||||
"contacts_not_found": "Чатов нет<br />¯∖_(ツ)_/¯",
|
||||
@@ -864,7 +871,8 @@
|
||||
"push_init_failed": "Ошибка инициализации пуш уведомлений",
|
||||
"invalid_security_token": "Токен некорректен",
|
||||
"no_connection": "Нет связи",
|
||||
"code_doesnot_match": "Код не совпадает"
|
||||
"code_doesnot_match": "Код не совпадает",
|
||||
"channel_prompt": "Создать канал"
|
||||
},
|
||||
"zh": {
|
||||
"archived_contacts": "已归档联系人 ({count})",
|
||||
@@ -1038,6 +1046,7 @@
|
||||
"push_init_failed": "初始化推送通知失败",
|
||||
"invalid_security_token": "无效的安全令牌",
|
||||
"no_connection": "无连接",
|
||||
"code_doesnot_match": "代码不匹配"
|
||||
"code_doesnot_match": "代码不匹配",
|
||||
"channel_prompt": "这是一个频道"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags);
|
||||
this.props.onCreateTopic(undefined, vcard(name, dataUrl), priv, tags, isChannel);
|
||||
}
|
||||
|
||||
handleGroupByID(topicName) {
|
||||
|
||||
@@ -1061,9 +1061,9 @@ class TinodeWeb extends React.Component {
|
||||
}
|
||||
|
||||
// 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 = {
|
||||
_topicName: topicName,
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
|
||||
import AvatarUpload from './avatar-upload.jsx';
|
||||
import CheckBox from './checkbox.jsx';
|
||||
import TagManager from './tag-manager.jsx';
|
||||
|
||||
import { MAX_TITLE_LENGTH } from '../config.js';
|
||||
@@ -14,14 +15,15 @@ export default class NewTopicGroup extends React.PureComponent {
|
||||
fn: '', // full/formatted name
|
||||
private: '',
|
||||
imageDataUrl: null,
|
||||
tags: []
|
||||
tags: [],
|
||||
isChannel: false
|
||||
};
|
||||
|
||||
this.handleFnChange = this.handleFnChange.bind(this);
|
||||
this.handlePrivateChange = this.handlePrivateChange.bind(this);
|
||||
this.handleImageChanged = this.handleImageChanged.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);
|
||||
}
|
||||
|
||||
@@ -41,13 +43,17 @@ export default class NewTopicGroup extends React.PureComponent {
|
||||
this.setState({tags: tags});
|
||||
}
|
||||
|
||||
handleChannelToggle() {
|
||||
this.setState({isChannel: !this.state.isChannel});
|
||||
}
|
||||
|
||||
handleSubmit(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const fn = this.state.fn.trim().substring(0, MAX_TITLE_LENGTH);
|
||||
const comment = this.state.private.trim().substring(0, MAX_TITLE_LENGTH);
|
||||
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}
|
||||
onImageChanged={this.handleImageChanged} />
|
||||
</div>
|
||||
<div className="panel-form-row">
|
||||
<CheckBox checked={this.state.isChannel} onChange={this.handleChannelToggle}/>
|
||||
<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">{
|
||||
(title) => <TagManager
|
||||
tags={this.state.tags}
|
||||
|
||||
Reference in New Issue
Block a user