]> git.mxchange.org Git - friendica.git/blobdiff - mod/poke.php
Some improvements
[friendica.git] / mod / poke.php
index 0619a34e07535a2682466729d5d3c1ca3143aa8b..83f3bf1c735894fcfd37b058f45975387ad55e09 100644 (file)
@@ -1,45 +1,50 @@
-<?php /** @file */
+<?php
 
 /**
- *
  * Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
  * This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
- * other web request. You must be logged in and connected to a profile. 
+ * other web request. You must be logged in and connected to a profile.
  * If the required arguments aren't present, we'll display a simple form to choose a recipient and a verb.
  * parent is a special argument which let's you attach this activity as a comment to an existing conversation, which
  * may have started with somebody else poking (etc.) somebody, but this isn't necessary. This can be used in the more pokes
- * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.  
+ * plugin version to have entire conversations where Alice poked Bob, Bob fingered Alice, Alice hugged Bob, etc.
  *
  * private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
  *
+ * @file mod/poke.php
  */
 
+use Friendica\App;
+
 require_once('include/security.php');
 require_once('include/bbcode.php');
 require_once('include/items.php');
 
+function poke_init(App $a) {
 
-function poke_init(&$a) {
-
-       if(! local_user())
+       if (! local_user()) {
                return;
+       }
 
        $uid = local_user();
        $verb = notags(trim($_GET['verb']));
 
-       if(! $verb)
+       if (! $verb) {
                return;
+       }
 
        $verbs = get_poke_verbs();
 
-       if(! array_key_exists($verb,$verbs))
+       if (! array_key_exists($verb,$verbs)) {
                return;
+       }
 
        $activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]);
 
        $contact_id = intval($_GET['cid']);
-       if(! $contact_id)
+       if (! $contact_id) {
                return;
+       }
 
        $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0);
 
@@ -52,7 +57,7 @@ function poke_init(&$a) {
                intval($uid)
        );
 
-       if(! dbm::is_result($r)) {
+       if (! dbm::is_result($r)) {
                logger('poke: no contact ' . $contact_id);
                return;
        }
@@ -144,9 +149,9 @@ function poke_init(&$a) {
 
 
 
-function poke_content(&$a) {
+function poke_content(App $a) {
 
-       if(! local_user()) {
+       if (! local_user()) {
                notice( t('Permission denied.') . EOL);
                return;
        }