8000 Bootstrap `Contact` profile (#242) by skazkiful · Pull Request #250 · team113/messenger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Bootstrap Contact profile (#242) #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
< 8000 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ All user visible changes to this project will be documented in this file. This p
- Redesigned desktop context menu. ([#245])
- Auth page:
- Redesigned login modal. ([#249])
- Redesigned contact page. ([#250], [#242])

### Fixed

Expand Down Expand Up @@ -83,9 +84,11 @@ All user visible changes to this project will be documented in this file. This p
[#232]: /../../issues/232
[#233]: /../../issues/233
[#241]: /../../pull/241
[#242]: /../../issues/242
[#245]: /../../pull/245
[#246]: /../../pull/246
[#249]: /../../pull/249
[#250]: /../../pull/250



Expand Down
1 change: 1 addition & 0 deletions assets/icons/btn_mute.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/btn_unmute.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/chat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/icons/delete.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/timer.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/l10n/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ btn_call_video_on_desc =
btn_change = Change
btn_change_avatar = Change avatar
btn_change_password = Change password
btn_clear_chat = Clear chat
btn_close = Close
btn_confirm = Confirm
btn_copy_text = Copy text
Expand Down Expand Up @@ -169,6 +170,7 @@ btn_proceed = Proceed
btn_remove = Remove
btn_rename = Rename
btn_reply = Reply to message
btn_report = Report
btn_resend_code = Resend confirmation code
btn_resend_message = Resend message
btn_save = Save
Expand Down Expand Up @@ -270,6 +272,7 @@ err_you_already_has_unconfirmed_phone = You already has unconfirmed Phone
err_you_are_blacklisted = You are blacklisted
err_you_are_not_member = Not a member
label_a_of_b = {$a} of {$b}
label_actions = Actions
label_add_chat_member = Add member
label_add_email = Add an email
label_add_email_hint = Write your email address
Expand Down Expand Up @@ -359,16 +362,19 @@ label_chat_members = Members
label_chat_monolog = Saved messages
label_chats = Messages
label_contact = Contact
label_contact_information = Contact information
label_contacts = Contacts
label_copied_to_clipboard = Copied to the clipboard
label_copy = Copy
label_create_group = Group creation
label_create_group_selected = Selected
label_create_group_users = user(s)
label_current_password = Current password
label_delete_email = Delete Email
label_delete_for_everyone = Delete for everyone
label_delete_for_me = Delete for me
label_delete_message = Delete the message?
label_delete_phone_number = Delete phone number
label_delivered = Delivered
label_dialog_created = Dialog created
label_direct_chat_link = Direct chat link
Expand Down Expand Up @@ -397,6 +403,7 @@ label_duration_hour_short = h
label_duration_minute_short = m
label_duration_second_short = s
label_edit = Edit
label_email = Email
label_email_confirmation_code_was_sent =
Confirmation code was send to your Email and/or to your phone
label_emails = Emails
Expand Down Expand Up @@ -483,12 +490,14 @@ label_password_set = Password has been set.
label_personalization = Personalization
label_phone_confirmation_code_was_send =
Confirmation code was send to your phone number
label_phone_number = Phone number
label_phones = Phones
label_photo = Photo
label_presence = Presence
label_presence_away = Away
label_presence_hidden = Hidden
label_presence_present = Last visit information
label_public_information = Public information
label_read_by = Read by
label_recent = Recent
label_recover_account = Access recovery
Expand Down Expand Up @@ -545,6 +554,7 @@ label_video_downloaded = Video downloaded.
label_video_saved_to_gallery = Video saved to gallery.
label_was_added = {$who} was added
label_was_removed = {$who} was removed
label_will_be_removed = will be removed
label_you = You
label_you_were_added_to_group = You were added to the group
plus = +
Expand Down
10 changes: 10 additions & 0 deletions assets/l10n/ru-RU.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ btn_call_video_on_desc =
btn_change = Сменить
btn_change_avatar = Изменить аватар
btn_change_password = Сменить пароль
btn_clear_chat = Очистить чат
btn_close = Закрыть
btn_confirm = Подтвердить
btn_copy_text = Скопировать текст
Expand Down Expand Up @@ -169,6 +170,7 @@ btn_proceed = Продолжить
btn_remove = Удалить
btn_rename = Переименовать
btn_reply = Ответить на сообщение
btn_report = Пожаловаться
btn_resend_code = Отправить код ещё раз
btn_resend_message = Повторить отправку
btn_save = Сохранить
Expand Down Expand Up @@ -274,6 +276,7 @@ err_you_already_has_unconfirmed_phone =
err_you_are_blacklisted = Вы в чёрном списке
err_you_are_not_member = Вы не состоите в чате
label_a_of_b = {$a} из {$b}
label_actions = Действия
label_add_chat_member = Добавление участника
label_add_email = Добавить почту
label_add_email_hint = Напишите адрес Вашей почты
Expand Down Expand Up @@ -376,16 +379,19 @@ label_chat_members = Участники
label_chat_monolog = Сохранённые сообщения
label_chats = Чаты
label_contact = Контакт
label_contact_information = Контактная информация
label_contacts = Контакты
label_copied_to_clipboard = Скопировано в буфер обмена
label_copy = Копировать
label_create_group = Создание группы
label_create_group_selected = Выбрано
label_create_group_users = пользователь(ей)
label_current_password = Текущий пароль
label_delete_email = Удалить Email
label_delete_for_everyone = Удалить для всех
label_delete_for_me = Удалить для меня
label_delete_message = Удалить сообщение?
label_delete_phone_number = Удалить номер телефона
label_delivered = Доставлено
label_dialog_created = Диалог создан
label_direct_chat_link = Прямая ссылка на чат
Expand Down Expand Up @@ -416,6 +422,7 @@ label_duration_hour_short = ч
label_duration_minute_short = м
label_duration_second_short = с
label_edit = Редактировать
label_email = Email
label_email_confirmation_code_was_sent =
Код подтверждения был отправлен Вам на Email и/или на телефон
label_emails = Эл.почта
Expand Down Expand Up @@ -505,12 +512,14 @@ label_password_set = Пароль задан.
label_personalization = Персонализация
label_phone_confirmation_code_was_send =
Код подтверждения был отправлен Вам на номер телефона
label_phone_number = Номер телефона
label_phones = Телефоны
label_photo = Фото
label_presence = Отображение статуса
label_presence_away = Отошёл
label_presence_hidden = Скрыт
label_presence_present = Информация о последнем входе
label_public_information = Публичная информация
label_read_by = Прочитано
label_recent = Недавние
label_recover_account = Восстановление доступа
Expand Down Expand Up @@ -568,6 +577,7 @@ label_video_downloaded = Видео загружено.
label_video_saved_to_gallery = Видео сохранено в галерею.
label_was_added = {$who} был(а) добавлен(а)
label_was_removed = {$who} был(а) удален(а)
label_will_be_removed = будет удален
label_you = Вы
label_you_were_added_to_group = Вас добавили в группу
plus = +
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright © 2022 IT ENGINEERING MANAGEMENT INC, <https://github.com/team113>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License v3.0 as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License v3.0 for
# more details.
#
# You should have received a copy of the GNU Affero General Public License v3.0
# along with this program. If not, see
# <https://www.gnu.org/licenses/agpl-3.0.html>.

mutation CreateChatContactRecord(
$id: ChatContactId!
$record: ChatContactRecord!
) {
createChatContactRecord(id: $id, record: $record) {
__typename
... on ChatContactEventsVersioned {
...ChatContactEventsVersioned
}
... on CreateChatContactRecordError {
code
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright © 2022 IT ENGINEERING MANAGEMENT INC, <https://github.com/team113>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License v3.0 as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License v3.0 for
# more details.
#
# You should have received a copy of the GNU Affero General Public License v3.0
# along with this program. If not, see
# <https://www.gnu.org/licenses/agpl-3.0.html>.

mutation DeleteChatContactRecord(
$id: ChatContactId!
$record: ChatContactRecord!
) {
deleteChatContactRecord(id: $id, record: $record) {
__typename
... on ChatContactEventsVersioned {
...ChatContactEventsVersioned
}
... on DeleteChatContactRecordError {
code
}
}
}
21 changes: 21 additions & 0 deletions lib/domain/repository/contact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'dart:async';

import 'package:get/get.dart';

import '../model/chat.dart';
import '../model/contact.dart';
import '../model/user.dart';
import '../repository/user.dart';
Expand Down Expand Up @@ -57,6 +58,26 @@ abstract class AbstractContactRepository {
/// Updates `name` of the specified [ChatContact] in the authenticated
/// [MyUser]'s address book.
Future<void> changeContactName(ChatContactId id, UserName name);

/// Creates a new contact record in the specified [ChatContact] of the
/// authenticated [MyUser]'s address book.
Future<void> createChatContactRecord(
ChatContactId id, {
User? user,
Chat? group,
UserEmail? email,
UserPhone? phone,
});

/// Removes the specified contact record from the specified [ChatContact] in
/// the authenticated [MyUser]'s address book.
Future<void> deleteChatContactRecord(
ChatContactId id, {
User? user,
Chat? group,
UserEmail? email,
UserPhone? phone,
});
}

/// Unified reactive [ChatContact] entity.
Expand Down
35 changes: 35 additions & 0 deletions lib/domain/service/contact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import 'package:get/get.dart';

import '../model/chat.dart';
import '../model/contact.dart';
import '../repository/contact.dart';
import '/domain/model/user.dart';
Expand Down Expand Up @@ -66,4 +67,38 @@ class ContactService extends DisposableService {
/// [MyUser]'s address book.
Future<void> changeContactName(ChatContactId id, UserName name) =>
_contactRepository.changeContactName(id, name);

/// Creates a new contact record in the specified [ChatContact] of the
/// authenticated [MyUser]'s address book.
Future<void> createChatContactRecord(
ChatContactId id, {
User? user,
Chat? group,
UserEmail? email,
UserPhone? phone,
}) =>
_contactRepository.createChatContactRecord(
id,
user: user,
group: group,
email: email,
phone: phone,
);

/// Removes the specified contact record from the specified [ChatContact] in
/// the authenticated [MyUser]'s address book.
Future<void> deleteChatContactRecord(
ChatContactId id, {
User? user,
Chat? group,
UserEmail? email,
UserPhone? phone,
}) =>
_contactRepository.deleteChatContactRecord(
id,
user: user,
group: group,
email: email,
phone: phone,
);
}
Loading
0