diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 19:26:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-23 19:26:38 -0300 |
commit | 9f31ba02a50d8930a5ce6d9365fcd4a454218271 (patch) | |
tree | a4ff47419ccc045901ce250696dc992314e9f835 /muamba.misc.inc | |
parent | eccec7929df788834f12ba4c6efbccf85a30d530 (diff) | |
download | muamba-9f31ba02a50d8930a5ce6d9365fcd4a454218271.tar.gz muamba-9f31ba02a50d8930a5ce6d9365fcd4a454218271.tar.bz2 |
Privatemsg integration
Diffstat (limited to 'muamba.misc.inc')
-rw-r--r-- | muamba.misc.inc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/muamba.misc.inc b/muamba.misc.inc index 4168464..25fceac 100644 --- a/muamba.misc.inc +++ b/muamba.misc.inc @@ -13,7 +13,17 @@ */ function muamba_request($nid) { // Sanitize - $nid = (int) $nid; + $nid = (int) $nid; + $node = node_load($nid); + if (!$node) { + // TODO: error + return; + } + + global $user; + + // TODO: check if user is not blocked? + privatemsg_new_thread(array(user_load($node->uid)), 'User request', 'User has requested an item'); return t('You have requested an item'); } |