2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

fixed adding contacts from shared contacts

This commit is contained in:
John Preston
2015-09-02 13:20:33 +03:00
parent ad089cb8da
commit 4d7e90f7e9
8 changed files with 28 additions and 23 deletions

View File

@@ -78,7 +78,7 @@ void TopBarWidget::onInfoClicked() {
void TopBarWidget::onAddContact() {
PeerData *p = App::main() ? App::main()->profilePeer() : 0;
UserData *u = (p && !p->chat) ? p->asUser() : 0;
if (u) App::wnd()->showLayer(new AddContactBox(u->firstName, u->lastName, u->phone));
if (u) App::wnd()->showLayer(new AddContactBox(u->firstName, u->lastName, u->phone.isEmpty() ? App::phoneFromSharedContact(App::userFromPeer(u->id)) : u->phone));
}
void TopBarWidget::onEdit() {
@@ -278,7 +278,7 @@ void TopBarWidget::showAll() {
return;
}
PeerData *p = App::main() ? App::main()->profilePeer() : 0, *o = App::main() ? App::main()->overviewPeer() : 0;
if (p && (p->chat || p->asUser()->contact >= 0)) {
if (p && (p->chat || p->asUser()->contact >= 0 || !App::phoneFromSharedContact(App::userFromPeer(p->id)).isEmpty())) {
if (p->chat) {
if (p->asChat()->forbidden) {
_edit.hide();