aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/item.php27
-rw-r--r--mod/ping.php6
2 files changed, 23 insertions, 10 deletions
diff --git a/mod/item.php b/mod/item.php
index dad883f50..6644be291 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -35,6 +35,23 @@ function item_post(&$a) {
$channel = null;
$observer = null;
+
+ /**
+ * Is this a reply to something?
+ */
+
+ $parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
+ $parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
+
+ $remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false);
+ $r = q("select * from xchan where xchan_hash = '%s' limit 1",
+ dbesc($remote_xchan)
+ );
+ if($r)
+ $remote_observer = $r[0];
+ else
+ $remote_xchan = $remote_observer = false;
+
$profile_uid = ((x($_REQUEST,'profile_uid')) ? intval($_REQUEST['profile_uid']) : 0);
require_once('include/identity.php');
$sys = get_sys_channel();
@@ -116,13 +133,6 @@ function item_post(&$a) {
$item_flags = $item_restrict = 0;
- /**
- * Is this a reply to something?
- */
-
- $parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
- $parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
-
$route = '';
$parent_item = null;
$parent_contact = null;
@@ -275,6 +285,9 @@ function item_post(&$a) {
$walltowall = false;
$walltowall_comment = false;
+ if($remote_xchan)
+ $observer = $remote_observer;
+
if($observer) {
logger('mod_item: post accepted from ' . $observer['xchan_name'] . ' for ' . $owner_xchan['xchan_name'], LOGGER_DEBUG);
diff --git a/mod/ping.php b/mod/ping.php
index 001c5594d..b676726fe 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -274,7 +274,7 @@ function ping_init(&$a) {
$r = q("SELECT * FROM item
WHERE item_restrict = 0 and item_unseen = 1 and uid = %d
- and author_xchan != '%s' ORDER BY created DESC",
+ and author_xchan != '%s' ORDER BY created DESC limit 300",
intval(local_channel()),
dbesc($ob_hash)
);
@@ -295,7 +295,7 @@ function ping_init(&$a) {
if(argc() > 1 && (argv(1) === 'intros')) {
$result = array();
- $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC",
+ $r = q("SELECT * FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d) > 0 and not ((abook_flags & %d) > 0 or (xchan_flags & %d) > 0) ORDER BY abook_created DESC LIMIT 50",
intval(local_channel()),
intval(ABOOK_FLAG_PENDING),
intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED),
@@ -327,7 +327,7 @@ function ping_init(&$a) {
$r = q("SELECT * FROM event left join xchan on event_xchan = xchan_hash
WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0
- ORDER BY `start` DESC ",
+ ORDER BY `start` DESC LIMIT 1000",
intval(local_channel()),
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + ' . intval($evdays) . ' days')),
dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days'))