]> git.mxchange.org Git - friendica.git/commitdiff
Remove group management restrictions on pending and blocked in Module\Group
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 24 Dec 2019 21:44:43 +0000 (16:44 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 24 Dec 2019 21:44:43 +0000 (16:44 -0500)
src/Module/Group.php

index 4c7672c01a7285d855547028cfb8072f7fd9c0be..5699d2d30bf87d586477ec66b33e79520cc95bf2 100644 (file)
@@ -87,34 +87,28 @@ class Group extends BaseModule
                                        throw new \Exception(L10n::t('Unknown group.'), 404);
                                }
 
-                               $contact = DBA::selectFirst('contact', ['pending', 'blocked', 'deleted'], ['id' => $contact_id, 'uid' => local_user()]);
+                               $contact = DBA::selectFirst('contact', ['deleted'], ['id' => $contact_id, 'uid' => local_user()]);
                                if (!DBA::isResult($contact)) {
                                        throw new \Exception(L10n::t('Contact not found.'), 404);
                                }
 
-                               if ($contact['pending']) {
-                                       throw new \Exception(L10n::t('Contact is unavailable.'), 400);
-                               }
-
                                if ($contact['deleted']) {
                                        throw new \Exception(L10n::t('Contact is deleted.'), 410);
                                }
 
                                switch($command) {
                                        case 'add':
-                                               if ($contact['blocked']) {
-                                                       throw new \Exception(L10n::t('Contact is blocked, unable to add it to a group.'), 400);
-                                               }
-
                                                if (!Model\Group::addMember($group_id, $contact_id)) {
                                                        throw new \Exception(L10n::t('Unable to add the contact to the group.'), 500);
                                                }
+
                                                $message = L10n::t('Contact successfully added to group.');
                                                break;
                                        case 'remove':
                                                if (!Model\Group::removeMember($group_id, $contact_id)) {
                                                        throw new \Exception(L10n::t('Unable to remove the contact from the group.'), 500);
                                                }
+
                                                $message = L10n::t('Contact successfully removed from group.');
                                                break;
                                        default: