if ($application_name == "")
$application_name = $a->get_hostname();
+ $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
+
$params["type"] = "client_associate";
- $params["contacts"] = $a->config['admin_email'];
+ $params["contacts"] = $adminlist[0];
$params["application_type"] = "native";
$params["application_name"] = $application_name;
$params["logo_url"] = $a->get_baseurl()."/images/friendica-256.png";
set_pconfig(local_user(),'pumpio','mirror',false);
set_pconfig(local_user(),'pumpio','post_by_default',false);
set_pconfig(local_user(),'pumpio','lastdate', 0);
+ set_pconfig(local_user(),'pumpio','last_id', '');
} else {
// filtering the username if it is filled wrong
$user = $_POST['pumpio_user'];
$title = trim($b['title']);
- //if ($title != '')
- // $title = "<h4>".$title."</h4>";
-
$content = bbcode($b['body'], false, false, 4);
// Enhance the way, videos are displayed
$success = $client->CallAPI($url, 'POST', $params, array('FailOnAccessError'=>true, 'RequestContentType'=>'application/json'), $user);
if($success) {
+
+ if ($user->generator->displayName)
+ set_pconfig($b["uid"], "pumpio", "application_name", $user->generator->displayName);
+
$post_id = $user->object->id;
logger('pumpio_send '.$username.': success '.$post_id);
if($post_id AND $iscomment) {
$hostname = get_pconfig($uid, 'pumpio','host');
$username = get_pconfig($uid, "pumpio", "user");
- $application_name = get_config('pumpio', 'application_name');
-
+ // get the application name for the pump.io app
+ // 1st try personal config, then system config and fallback to the
+ // hostname of the node if neither one is set.
+ $application_name = get_pconfig( $uid, 'pumpio', 'application_name');
+ if ($application_name == "")
+ $application_name = get_config('pumpio', 'application_name');
if ($application_name == "")
$application_name = $a->get_hostname();
if ($receiver->id == "http://activityschema.org/collection/public")
$public = true;
- if ($public AND !strstr($post->generator->displayName, $application_name)) {
+ if ($public AND !stristr($post->generator->displayName, $application_name)) {
require_once('include/html2bbcode.php');
$_SESSION["authenticated"] = true;
$public = true;
$postarray = array();
+ $postarray['network'] = NETWORK_PUMPIO;
$postarray['gravity'] = 0;
$postarray['uid'] = $uid;
$postarray['wall'] = 0;
$postarray['body'] = "[share author='".$post->object->author->displayName.
"' profile='".$post->object->author->url.
"' avatar='".$post->object->author->image->url.
+ "' posted='".datetime_convert('UTC','UTC',$post->object->created).
"' link='".$post->links->self->href."']".$postarray['body']."[/share]";
} else {
// Let shares look like wall-to-wall posts
return false;
$top_item = item_store($postarray);
+ $postarray["id"] = $top_item;
if (($top_item == 0) AND ($post->verb == "update")) {
$r = q("UPDATE `item` SET `title` = '%s', `body` = '%s' , `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d",