Skip to content

Commit

Permalink
GH-126 Clean up copy messages handling & explain what's going on
Browse files Browse the repository at this point in the history
  • Loading branch information
mdziekon committed Oct 25, 2020
1 parent 99c6b94 commit 6d666ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 9 additions & 11 deletions messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,26 +510,24 @@
'messages'
);

while($CopyData = $SQLResult_GetMassMessages->fetch_assoc())
{
if($CopyData['type'] == 80 OR $CopyData['type'] == 2)
{
while ($CopyData = $SQLResult_GetMassMessages->fetch_assoc()) {
if (Messages\Utils\isUserSentMessage($CurMess)) {
$CopyData['text'] = Messages\Utils\formatUserMessageContent($CopyData);

foreach($CopyMsgMap[$CopyData['id']] as $MsgKey)
{
foreach ($CopyMsgMap[$CopyData['id']] as $MsgKey) {
$Messages[$MsgKey]['CurrMSG_subject'] = $CopyData['subject'];
$Messages[$MsgKey]['CurrMSG_text'] = $CopyData['text'];
if($CopyData['type'] == 2)
{
$Messages[$MsgKey]['CurrMSG_from'] .= ' '.$CopyData['from'];
}
}
}
else
{
foreach($CopyMsgMap[$CopyData['id']] as $MsgKey)
{
} else {
// System-sent messages should not appear
// when using messages copy-referencing system,
// report as an error.

foreach ($CopyMsgMap[$CopyData['id']] as $MsgKey) {
$Messages[$MsgKey]['CurrMSG_subject'] = $_Lang['msg_const']['subjects']['019'];
$Messages[$MsgKey]['CurrMSG_text'] = sprintf($_Lang['msg_const']['msgs']['err3'], $CopyData['id']);
}
Expand Down
1 change: 1 addition & 0 deletions modules/messages/utils/buildMessageDetails.utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ function _buildTypedUserMessageDetails($dbMessageData, $params) {
$messageDetails['isCarbonCopy'] = true;
$messageDetails['carbonCopyOriginalId'] = $originalMessageId;

// Temporarily set content as error, later to be replaced by copy injector
$messageParsedContent = sprintf(
$_Lang['msg_const']['msgs']['err4'],
$dbMessageData['id']
Expand Down

0 comments on commit 6d666ef

Please sign in to comment.