android: UI for pending contact connections, ios: translations, show profile picture in contact requests (#571)

* android: UI for pending contact connections, ios: translations, show profile picture in contact requests

* update translations

Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>

* update translation

Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>

Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>
This commit is contained in:
Evgeny Poberezkin
2022-04-26 07:41:08 +01:00
committed by GitHub
parent cd2eb9c88e
commit 44de6297ee
20 changed files with 505 additions and 67 deletions
+6 -2
View File
@@ -713,8 +713,10 @@ func processReceivedMsg(_ res: ChatResponse) {
m.terminalItems.append(.resp(.now, res))
logger.debug("processReceivedMsg: \(res.responseType)")
switch res {
case let .newContactConnection(contactConnection):
m.updateContactConnection(contactConnection)
case let .newContactConnection(connection):
m.updateContactConnection(connection)
case let .contactConnectionDeleted(connection):
m.removeChat(connection.id)
case let .contactConnected(contact):
m.updateContact(contact)
m.removeChat(contact.activeConn.id)
@@ -961,6 +963,7 @@ enum StoreError: Decodable {
case fileNotFound(fileId: Int64)
case rcvFileInvalid(fileId: Int64)
case connectionNotFound(agentConnId: String)
case pendingConnectionNotFound(connId: Int64)
case introNotFound
case uniqueID
case internalError(message: String)
@@ -969,6 +972,7 @@ enum StoreError: Decodable {
case chatItemNotFound(itemId: Int64)
case quotedChatItemNotFound
case chatItemSharedMsgIdNotFound(sharedMsgId: String)
case chatItemNotFoundByFileId(fileId: Int64)
}
enum AgentErrorType: Decodable {
@@ -108,7 +108,7 @@ struct ChatListNavLink: View {
}
private func contactRequestNavLink(_ contactRequest: UserContactRequest) -> some View {
ContactRequestView(contactRequest: contactRequest)
ContactRequestView(contactRequest: contactRequest, chat: chat)
.swipeActions(edge: .trailing, allowsFullSwipe: true) {
Button { Task { await acceptContactRequest(contactRequest) } }
label: { Label("Accept", systemImage: "checkmark") }
@@ -10,14 +10,12 @@ import SwiftUI
struct ContactRequestView: View {
var contactRequest: UserContactRequest
@ObservedObject var chat: Chat
var body: some View {
return HStack(spacing: 8) {
Image(systemName: "person.crop.circle.fill")
.resizable()
.foregroundColor(Color(uiColor: .secondarySystemBackground))
ChatInfoImage(chat: chat)
.frame(width: 63, height: 63)
.padding(.leading, 4)
VStack(alignment: .leading, spacing: 4) {
HStack(alignment: .top) {
Text(contactRequest.chatViewName)
@@ -47,7 +45,7 @@ struct ContactRequestView: View {
struct ContactRequestView_Previews: PreviewProvider {
static var previews: some View {
ContactRequestView(contactRequest: UserContactRequest.sampleData)
ContactRequestView(contactRequest: UserContactRequest.sampleData, chat: Chat(chatInfo: ChatInfo.sampleData.contactRequest , chatItems: []))
.previewLayout(.fixed(width: 360, height: 80))
}
}
@@ -17,6 +17,7 @@ struct ChatInfoImage: View {
switch chat.chatInfo {
case .direct: iconName = "person.crop.circle.fill"
case .group: iconName = "person.2.circle.fill"
case .contactRequest: iconName = "person.crop.circle.fill"
default: iconName = "circle.fill"
}
return ProfileImage(
@@ -340,6 +340,11 @@
<target>Delete pending connection</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Delete pending connection?" xml:space="preserve">
<source>Delete pending connection?</source>
<target>Delete pending connection?</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Develop" xml:space="preserve">
<source>Develop</source>
<target>Develop</target>
@@ -597,6 +602,11 @@ to scan from the app</source>
to scan from the app</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Show pending connections" xml:space="preserve">
<source>Show pending connections</source>
<target>Show pending connections</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Take picture" xml:space="preserve">
<source>Take picture</source>
<target>Take picture</target>
@@ -624,6 +634,16 @@ to scan from the app</target>
*Please note*: if you confirm, your device token will be sent to SimpleX Chat notifications server.</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The connection you accepted will be cancelled!" xml:space="preserve">
<source>The connection you accepted will be cancelled!</source>
<target>The connection you accepted will be cancelled!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The contact you shared this link with will NOT be able to connect!" xml:space="preserve">
<source>The contact you shared this link with will NOT be able to connect!</source>
<target>The contact you shared this link with will NOT be able to connect!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The messaging and application platform 100% private by design!" xml:space="preserve">
<source>The messaging and application platform 100% private by design!</source>
<target>The messaging and application platform 100% private by design!</target>
@@ -691,6 +711,11 @@ To connect, please ask your contact to create another connection link and check
<target>You</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You accepted connection" xml:space="preserve">
<source>You accepted connection</source>
<target>You accepted connection</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You are already connected to %@ via this link." xml:space="preserve">
<source>You are already connected to %@ via this link.</source>
<target>You are already connected to %@ via this link.</target>
@@ -726,6 +751,11 @@ To connect, please ask your contact to create another connection link and check
<target>You control your chat!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You invited your contact" xml:space="preserve">
<source>You invited your contact</source>
<target>You invited your contact</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You will be connected when your connection request is accepted, please wait or check later!" xml:space="preserve">
<source>You will be connected when your connection request is accepted, please wait or check later!</source>
<target>You will be connected when your connection request is accepted, please wait or check later!</target>
@@ -830,11 +860,31 @@ SimpleX servers cannot see your profile.</target>
<target>connect to SimpleX Chat developers.</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="connecting…" xml:space="preserve">
<source>connecting…</source>
<target>connecting…</target>
<note>chat list item title</note>
</trans-unit>
<trans-unit id="connection established" xml:space="preserve">
<source>connection established</source>
<target>connection established</target>
<note>chat list item title (it should not be shown</note>
</trans-unit>
<trans-unit id="connection:%@" xml:space="preserve">
<source>connection:%@</source>
<target>connection:%@</target>
<note>connection information</note>
</trans-unit>
<trans-unit id="deleted" xml:space="preserve">
<source>deleted</source>
<target>deleted</target>
<note>deleted chat item</note>
</trans-unit>
<trans-unit id="invited to connect" xml:space="preserve">
<source>invited to connect</source>
<target>invited to connect</target>
<note>chat list item title</note>
</trans-unit>
<trans-unit id="italic" xml:space="preserve">
<source>italic</source>
<target>italic</target>
@@ -855,11 +905,26 @@ SimpleX servers cannot see your profile.</target>
<target>v%@ (%@)</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="via contact address link" xml:space="preserve">
<source>via contact address link</source>
<target>via contact address link</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="via one-time link" xml:space="preserve">
<source>via one-time link</source>
<target>via one-time link</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="wants to connect to you!" xml:space="preserve">
<source>wants to connect to you!</source>
<target>wants to connect to you!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="you shared one-time link" xml:space="preserve">
<source>you shared one-time link</source>
<target>you shared one-time link</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="~strike~" xml:space="preserve">
<source>~strike~</source>
<target>~strike~</target>
@@ -340,6 +340,11 @@
<target>Удалить соединение</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Delete pending connection?" xml:space="preserve">
<source>Delete pending connection?</source>
<target>Удалить ожидаемое соединение?</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Develop" xml:space="preserve">
<source>Develop</source>
<target>Для разработчиков</target>
@@ -596,6 +601,11 @@ to scan from the app</source>
<target>Покажите QR код вашему контакту для сканирования в приложении</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Show pending connections" xml:space="preserve">
<source>Show pending connections</source>
<target>Показать ожидаемые соединения</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="Take picture" xml:space="preserve">
<source>Take picture</source>
<target>Сделать фото</target>
@@ -623,6 +633,16 @@ to scan from the app</source>
*Обратите внимание*: если вы подтвердите, токен вашего устройства будет послан на сервер SimpleX Chat.</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The connection you accepted will be cancelled!" xml:space="preserve">
<source>The connection you accepted will be cancelled!</source>
<target>Подтвержденное соединение будет отменено!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The contact you shared this link with will NOT be able to connect!" xml:space="preserve">
<source>The contact you shared this link with will NOT be able to connect!</source>
<target>Контакт, которому вы отправили эту ссылку, не сможет соединиться!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="The messaging and application platform 100% private by design!" xml:space="preserve">
<source>The messaging and application platform 100% private by design!</source>
<target>Платформа для сообщений и приложений, которая защищает вашу личную информацию и безопасность.</target>
@@ -690,6 +710,11 @@ To connect, please ask your contact to create another connection link and check
<target>Вы</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You accepted connection" xml:space="preserve">
<source>You accepted connection</source>
<target>Вы приняли приглашение соединиться</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You are already connected to %@ via this link." xml:space="preserve">
<source>You are already connected to %@ via this link.</source>
<target>Вы уже соединены с %@ через эту ссылку.</target>
@@ -725,6 +750,11 @@ To connect, please ask your contact to create another connection link and check
<target>Вы котролируете Ваш чат!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You invited your contact" xml:space="preserve">
<source>You invited your contact</source>
<target>Вы пригласили ваш контакт</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="You will be connected when your connection request is accepted, please wait or check later!" xml:space="preserve">
<source>You will be connected when your connection request is accepted, please wait or check later!</source>
<target>Соединение будет установлено, когда ваш запрос будет принят. Пожалуйста, подождите или проверьте позже!</target>
@@ -829,11 +859,31 @@ SimpleX серверы не могут получить доступ к ваше
<target>соединитесь с разработчиками.</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="connecting…" xml:space="preserve">
<source>connecting…</source>
<target>соединяется…</target>
<note>chat list item title</note>
</trans-unit>
<trans-unit id="connection established" xml:space="preserve">
<source>connection established</source>
<target>соединение установлено</target>
<note>chat list item title (it should not be shown</note>
</trans-unit>
<trans-unit id="connection:%@" xml:space="preserve">
<source>connection:%@</source>
<target>connection:%@</target>
<note>connection information</note>
</trans-unit>
<trans-unit id="deleted" xml:space="preserve">
<source>deleted</source>
<target>удалено</target>
<note>deleted chat item</note>
</trans-unit>
<trans-unit id="invited to connect" xml:space="preserve">
<source>invited to connect</source>
<target>приглашение соединиться</target>
<note>chat list item title</note>
</trans-unit>
<trans-unit id="italic" xml:space="preserve">
<source>italic</source>
<target>курсив</target>
@@ -854,11 +904,26 @@ SimpleX серверы не могут получить доступ к ваше
<target>v%@ (%@)</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="via contact address link" xml:space="preserve">
<source>via contact address link</source>
<target>через ссылку-контакт</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="via one-time link" xml:space="preserve">
<source>via one-time link</source>
<target>через одноразовую ссылку</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="wants to connect to you!" xml:space="preserve">
<source>wants to connect to you!</source>
<target>хочет соединиться с вами!</target>
<note>No comment provided by engineer.</note>
</trans-unit>
<trans-unit id="you shared one-time link" xml:space="preserve">
<source>you shared one-time link</source>
<target>вы создали одноразовую ссылку</target>
<note>chat list item description</note>
</trans-unit>
<trans-unit id="~strike~" xml:space="preserve">
<source>~strike~</source>
<target>\~зачеркнуть~</target>
+39
View File
@@ -151,6 +151,9 @@
/* No comment provided by engineer. */
"Connecting server… (error: %@)" = "Устанавливается соединение с сервером… (ошибка: %@)";
/* chat list item title */
"connecting…" = "соединяется…";
/* No comment provided by engineer. */
"Connecting..." = "Устанавливается соединение…";
@@ -160,6 +163,9 @@
/* No comment provided by engineer. */
"Connection error (AUTH)" = "Ошибка соединения (AUTH)";
/* chat list item title (it should not be shown */
"connection established" = "соединение установлено";
/* No comment provided by engineer. */
"Connection request" = "Запрос на соединение";
@@ -169,6 +175,9 @@
/* No comment provided by engineer. */
"Connection timeout" = "Превышено время соединения";
/* connection information */
"connection:%@" = "connection:%@";
/* No comment provided by engineer. */
"Contact already exists" = "Существующий контакт";
@@ -229,6 +238,9 @@
/* No comment provided by engineer. */
"Delete pending connection" = "Удалить соединение";
/* No comment provided by engineer. */
"Delete pending connection?" = "Удалить ожидаемое соединение?";
/* deleted chat item */
"deleted" = "удалено";
@@ -295,6 +307,9 @@
/* No comment provided by engineer. */
"Invalid connection link" = "Ошибка в ссылке контакта";
/* chat list item title */
"invited to connect" = "приглашение соединиться";
/* No comment provided by engineer. */
"italic" = "курсив";
@@ -385,6 +400,9 @@
/* No comment provided by engineer. */
"Share link" = "Поделиться ссылкой";
/* No comment provided by engineer. */
"Show pending connections" = "Показать ожидаемые соединения";
/* No comment provided by engineer. */
"Show QR code to your contact\nto scan from the app" = "Покажите QR код вашему контакту для сканирования в приложении";
@@ -409,6 +427,12 @@
/* No comment provided by engineer. */
"The app can receive background notifications every 20 minutes to check the new messages.\n*Please note*: if you confirm, your device token will be sent to SimpleX Chat notifications server." = "Приложение может получать скрытые уведомления каждые 20 минут чтобы проверить новые сообщения.\n*Обратите внимание*: если вы подтвердите, токен вашего устройства будет послан на сервер SimpleX Chat.";
/* No comment provided by engineer. */
"The connection you accepted will be cancelled!" = "Подтвержденное соединение будет отменено!";
/* No comment provided by engineer. */
"The contact you shared this link with will NOT be able to connect!" = "Контакт, которому вы отправили эту ссылку, не сможет соединиться!";
/* No comment provided by engineer. */
"The messaging and application platform 100% private by design!" = "Платформа для сообщений и приложений, которая защищает вашу личную информацию и безопасность.";
@@ -445,6 +469,12 @@
/* No comment provided by engineer. */
"v%@ (%@)" = "v%@ (%@)";
/* chat list item description */
"via contact address link" = "через ссылку-контакт";
/* chat list item description */
"via one-time link" = "через одноразовую ссылку";
/* No comment provided by engineer. */
"wants to connect to you!" = "хочет соединиться с вами!";
@@ -454,6 +484,9 @@
/* No comment provided by engineer. */
"You" = "Вы";
/* No comment provided by engineer. */
"You accepted connection" = "Вы приняли приглашение соединиться";
/* No comment provided by engineer. */
"You are already connected to %@ via this link." = "Вы уже соединены с %@ через эту ссылку.";
@@ -475,6 +508,12 @@
/* No comment provided by engineer. */
"You control your chat!" = "Вы котролируете Ваш чат!";
/* No comment provided by engineer. */
"You invited your contact" = "Вы пригласили ваш контакт";
/* chat list item description */
"you shared one-time link" = "вы создали одноразовую ссылку";
/* No comment provided by engineer. */
"You will be connected when your connection request is accepted, please wait or check later!" = "Соединение будет установлено, когда ваш запрос будет принят. Пожалуйста, подождите или проверьте позже!";