summaryrefslogtreecommitdiff
path: root/classes/Message.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Message.php')
-rw-r--r--classes/Message.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/classes/Message.php b/classes/Message.php
index 353dc01f9..484d1f724 100644
--- a/classes/Message.php
+++ b/classes/Message.php
@@ -45,12 +45,19 @@ class Message extends Memcached_DataObject
throw new ClientException(_('You are banned from sending direct messages.'));
}
+ $user = User::staticGet('id', $sender->id);
+
$msg = new Message();
$msg->from_profile = $from;
$msg->to_profile = $to;
- $msg->content = common_shorten_links($content);
- $msg->rendered = common_render_text($content);
+ if ($user) {
+ // Use the sender's URL shortening options.
+ $msg->content = $user->shortenLinks($content);
+ } else {
+ $msg->content = common_shorten_links($content);
+ }
+ $msg->rendered = common_render_text($msg->content);
$msg->created = common_sql_now();
$msg->source = $source;