Browse Source

! Fold back in Subs-PersonalMessage.php to PersonalMessage.php and Subs-Post.php

Spuds 13 years ago
parent
commit
a5c82c7452
2 changed files with 23 additions and 8 deletions
  1. 18 2
      Sources/PersonalMessage.php
  2. 5 6
      Sources/Subs-Post.php

+ 18 - 2
Sources/PersonalMessage.php

@@ -2548,6 +2548,10 @@ function MessagePrune()
 
 /**
  * Delete the specified personal messages.
+ *
+ * @param array $personal_messages, array of pm ids
+ * @param string $folder = null
+ * @param int $owner = null
  */
 function deleteMessages($personal_messages, $folder = null, $owner = null)
 {
@@ -2680,7 +2684,13 @@ function deleteMessages($personal_messages, $folder = null, $owner = null)
 	cache_put_data('labelCounts:' . $user_info['id'], null, 720);
 }
 
-// Mark personal messages read.
+/**
+ * Mark the specified personal messages read.
+ *
+ * @param array $personal_messages = null, array of pm ids
+ * @param string $label = null, if label is set, only marks messages with that label
+ * @param int $owner = null, if owner is set, marks messages owned by that member id
+ */
 function markMessages($personal_messages = null, $label = null, $owner = null)
 {
 	global $user_info, $context, $smcFunc;
@@ -3568,7 +3578,13 @@ function LoadRules($reload = false)
 	$smcFunc['db_free_result']($request);
 }
 
-// Check if the PM is available to the current user.
+/**
+ * Check if the PM is available to the current user.
+ *
+ * @param int $pmID
+ * @param $validFor
+ * @return bool
+ */
 function isAccessiblePM($pmID, $validFor = 'in_or_outbox')
 {
 	global $user_info, $smcFunc;

+ 5 - 6
Sources/Subs-Post.php

@@ -790,15 +790,13 @@ function AddMailQueue($flush = false, $to_array = array(), $subject = '', $messa
  * Sends an personal message from the specified person to the specified people
  * ($from defaults to the user)
  *
- * @param array $recipients - an array containing the arrays 'to' and 'bcc',
- *  both containing id_member's.
+ * @param array $recipients - an array containing the arrays 'to' and 'bcc', both containing id_member's.
  * @param string $subject - should have no slashes and no html entities
  * @param string $message - should have no slashes and no html entities
  * @param bool $store_outbox
  * @param array $from - an array with the id, name, and username of the member.
  * @param int $pm_head - the ID of the chain being replied to - if any.
- * @return array, an array with log entries telling how many recipients were
- *  successful and which recipients it failed to send to.
+ * @return array, an array with log entries telling how many recipients were successful and which recipients it failed to send to.
  */
 function sendpm($recipients, $subject, $message, $store_outbox = false, $from = null, $pm_head = 0)
 {
@@ -832,7 +830,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 	preparsecode($htmlmessage);
 
 	// Integrated PMs
-	call_integration_hook('integrate_personal_message', array($recipients, $from['username'], $subject, $message));
+	call_integration_hook('integrate_personal_message', array(&$recipients, &$from['username'], &$subject, &$message));
 
 	// Get a list of usernames and convert them to IDs.
 	$usernames = array();
@@ -925,7 +923,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 	$smcFunc['db_free_result']($request);
 
 	// Load the membergrounp message limits.
-	//!!! Consider caching this?
+	// @todo Consider caching this?
 	static $message_limit_cache = array();
 	if (!allowedTo('moderate_forum') && empty($message_limit_cache))
 	{
@@ -941,6 +939,7 @@ function sendpm($recipients, $subject, $message, $store_outbox = false, $from =
 	}
 
 	// Load the groups that are allowed to read PMs.
+	// @todo move into a separate function on $permission.
 	$allowed_groups = array();
 	$disallowed_groups = array();
 	$request = $smcFunc['db_query']('', '