mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-12 03:18:48 +00:00
Merge pull request #157 from annando/master
Bidirectional twitter sync - and some small fixes
This commit is contained in:
commit
14676e5b0d
7 changed files with 1041 additions and 35 deletions
|
@ -484,7 +484,7 @@ function pumpio_send(&$a,&$b) {
|
|||
logger('pumpio_send '.$username.': success '.$post_id);
|
||||
if($post_id AND $iscomment) {
|
||||
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$b['id']);
|
||||
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
|
||||
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
|
||||
dbesc($post_id),
|
||||
intval($b['id'])
|
||||
);
|
||||
|
@ -925,7 +925,7 @@ function pumpio_get_contact($uid, $contact) {
|
|||
`name-date` = '%s',
|
||||
`uri-date` = '%s',
|
||||
`avatar-date` = '%s'
|
||||
WHERE `id` = %d LIMIT 1
|
||||
WHERE `id` = %d
|
||||
",
|
||||
dbesc($photos[0]),
|
||||
dbesc($photos[1]),
|
||||
|
@ -952,8 +952,10 @@ function pumpio_get_contact($uid, $contact) {
|
|||
`micro` = '%s',
|
||||
`name-date` = '%s',
|
||||
`uri-date` = '%s',
|
||||
`avatar-date` = '%s'
|
||||
WHERE `id` = %d LIMIT 1
|
||||
`avatar-date` = '%s',
|
||||
`name` = '%s',
|
||||
`nick` = '%s'
|
||||
WHERE `id` = %d
|
||||
",
|
||||
dbesc($photos[0]),
|
||||
dbesc($photos[1]),
|
||||
|
@ -961,6 +963,8 @@ function pumpio_get_contact($uid, $contact) {
|
|||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc($contact->displayName),
|
||||
dbesc($contact->preferredUsername),
|
||||
intval($r[0]['id'])
|
||||
);
|
||||
}
|
||||
|
@ -1129,10 +1133,17 @@ function pumpio_dopost(&$a, $client, $uid, $self, $post, $own_id, $threadcomplet
|
|||
}
|
||||
|
||||
if ($post->verb == "share") {
|
||||
$postarray['body'] = "[share author='".$post->object->author->displayName.
|
||||
"' profile='".$post->object->author->url.
|
||||
"' avatar='".$post->object->author->image->url.
|
||||
"' link='".$post->links->self->href."']".$postarray['body']."[/share]";
|
||||
if (!intval(get_config('system','wall-to-wall_share'))) {
|
||||
$postarray['body'] = "[share author='".$post->object->author->displayName.
|
||||
"' profile='".$post->object->author->url.
|
||||
"' avatar='".$post->object->author->image->url.
|
||||
"' link='".$post->links->self->href."']".$postarray['body']."[/share]";
|
||||
} else {
|
||||
// Let shares look like wall-to-wall posts
|
||||
$postarray['author-name'] = $post->object->author->displayName;
|
||||
$postarray['author-link'] = $post->object->author->url;
|
||||
$postarray['author-avatar'] = $post->object->author->image->url;
|
||||
}
|
||||
}
|
||||
|
||||
if (trim($postarray['body']) == "")
|
||||
|
@ -1350,7 +1361,7 @@ function pumpio_queue_hook(&$a,&$b) {
|
|||
logger('pumpio_queue: send '.$username.': success '.$post_id);
|
||||
if($post_id AND $iscomment) {
|
||||
logger('pumpio_send '.$username.': Update extid '.$post_id." for post id ".$z['item']);
|
||||
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1",
|
||||
q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d",
|
||||
dbesc($post_id),
|
||||
intval($z['item'])
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue