]> git.mxchange.org Git - friendica.git/blobdiff - mod/message.php
Version 2020.09-dev
[friendica.git] / mod / message.php
index bff62a554d6e036db96a75de3dc28807db83b8d0..c024cbe144cd49eaaa31e80ee1f7064d6b6222c9 100644 (file)
@@ -1,6 +1,22 @@
 <?php
 /**
- * @file mod/message.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License 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 for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 use Friendica\App;
@@ -8,12 +24,12 @@ use Friendica\Content\Nav;
 use Friendica\Content\Pager;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\ACL;
-use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Model\Mail;
+use Friendica\Model\Notify\Type;
 use Friendica\Module\Security\Login;
 use Friendica\Util\DateTimeFormat;
 use Friendica\Util\Proxy as ProxyUtils;
@@ -280,7 +296,7 @@ function message_content(App $a)
                        $total = $r[0]['total'];
                }
 
-               $pager = new Pager(DI::args()->getQueryString());
+               $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
 
                $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
 
@@ -336,13 +352,7 @@ function message_content(App $a)
                        $messages = DBA::toArray($messages_stmt);
 
                        DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]);
-
-                       if ($message['convid']) {
-                               // Clear Diaspora private message notifications
-                               DBA::update('notify', ['seen' => 1], ['type' => NOTIFY_MAIL, 'parent' => $message['convid'], 'uid' => local_user()]);
-                       }
-                       // Clear DFRN private message notifications
-                       DBA::update('notify', ['seen' => 1], ['type' => NOTIFY_MAIL, 'parent' => $message['parent-uri'], 'uid' => local_user()]);
+                       DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['id'], 'uid' => local_user()]);
                } else {
                        $messages = false;
                }