require('addon/pumpio/oauth/http.php');
require('addon/pumpio/oauth/oauth_client.php');
require_once('include/enotify.php');
require('addon/pumpio/oauth/http.php');
require('addon/pumpio/oauth/oauth_client.php');
require_once('include/enotify.php');
$consumer_secret = get_pconfig(local_user(), 'pumpio','consumer_secret');
$hostname = get_pconfig(local_user(), 'pumpio','host');
$consumer_secret = get_pconfig(local_user(), 'pumpio','consumer_secret');
$hostname = get_pconfig(local_user(), 'pumpio','host');
logger("pumpio_connect: register client");
$clientdata = pumpio_registerclient($a, $hostname);
set_pconfig(local_user(), 'pumpio','consumer_key', $clientdata->client_id);
logger("pumpio_connect: register client");
$clientdata = pumpio_registerclient($a, $hostname);
set_pconfig(local_user(), 'pumpio','consumer_key', $clientdata->client_id);
logger("pumpio_connect: ".sprintf("Unable to register the client at the pump.io server '%s'.", $hostname));
$o .= sprintf(t("Unable to register the client at the pump.io server '%s'."), $hostname);
logger("pumpio_connect: ".sprintf("Unable to register the client at the pump.io server '%s'.", $hostname));
$o .= sprintf(t("Unable to register the client at the pump.io server '%s'."), $hostname);
$s .= '<input id="pumpio-servername" type="text" name="pumpio_host" value="'.$servername.'" />';
$s .= '</div><div class="clear"></div>';
$s .= '<input id="pumpio-servername" type="text" name="pumpio_host" value="'.$servername.'" />';
$s .= '</div><div class="clear"></div>';
$oauth_token = get_pconfig(local_user(), "pumpio", "oauth_token");
$oauth_token_secret = get_pconfig(local_user(), "pumpio", "oauth_token_secret");
$s .= '<div id="pumpio-password-wrapper">';
$oauth_token = get_pconfig(local_user(), "pumpio", "oauth_token");
$oauth_token_secret = get_pconfig(local_user(), "pumpio", "oauth_token_secret");
$s .= '<div id="pumpio-password-wrapper">';
$s .= '<div id="pumpio-authenticate-wrapper">';
$s .= '<a href="'.$a->get_baseurl().'/pumpio/connect">'.t("Authenticate your pump.io connection").'</a>';
$s .= '</div><div class="clear"></div>';
$s .= '<div id="pumpio-authenticate-wrapper">';
$s .= '<a href="'.$a->get_baseurl().'/pumpio/connect">'.t("Authenticate your pump.io connection").'</a>';
$s .= '</div><div class="clear"></div>';
pumpio_action($a, $b["uid"], $b["uri"], "update", $b["body"]);
pumpio_action($a, $b["uid"], $b["uri"], "update", $b["body"]);
pumpio_action($a, $b["uid"], $b["uri"], "delete");
if($b['deleted'] || ($b['created'] !== $b['edited']))
pumpio_action($a, $b["uid"], $b["uri"], "delete");
if($b['deleted'] || ($b['created'] !== $b['edited']))
$inReplyTo["objectType"] = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
$params["object"] = array(
$inReplyTo["objectType"] = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
$params["object"] = array(
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']);
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
dbesc($post_id),
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']);
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
dbesc($post_id),
$objectType = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
elseif (strstr($uri, "/api/comment/"))
$objectType = "comment";
$objectType = str_replace(NAMESPACE_ACTIVITY_SCHEMA, '', $orig_post["object-type"]);
elseif (strstr($uri, "/api/comment/"))
$objectType = "comment";
return pumpio_dolike($a, $uid, $self, $post, $own_id);
return pumpio_dolike($a, $uid, $self, $post, $own_id);
return pumpio_dounlike($a, $uid, $self, $post, $own_id);
if ($post->verb == "delete")
return pumpio_dounlike($a, $uid, $self, $post, $own_id);
if ($post->verb == "delete")
if ($post->verb == "share") {
if (!intval(get_config('system','wall-to-wall_share'))) {
if ($post->verb == "share") {
if (!intval(get_config('system','wall-to-wall_share'))) {
$share_author = $post->object->author->preferredUsername;
else
$share_author = $post->object->author->url;
$share_author = $post->object->author->preferredUsername;
else
$share_author = $post->object->author->url;
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s' , `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d",
dbesc($postarray["title"]),
dbesc($postarray["body"]),
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s' , `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d",
dbesc($postarray["title"]),
dbesc($postarray["body"]),
foreach($myconv as $conv) {
// now if we find a match, it means we're in this conversation
foreach($myconv as $conv) {
// now if we find a match, it means we're in this conversation
- if(!link_compare($conv['author-link'],$importer_url) AND !link_compare($conv['author-link'],$own_id))
+ if(!link_compare($conv['author-link'],$importer_url) && !link_compare($conv['author-link'],$own_id))
- foreach ($users->items AS $user)
- pumpio_get_contact($uid, $user);
+ if (is_array($users->items)) {
+ foreach ($users->items AS $user) {
+ pumpio_get_contact($uid, $user);
+ }
+ }
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']);
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
dbesc($post_id),
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']);
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
dbesc($post_id),