Skip to content

Commit

Permalink
Messenger: post-merge tweaks to return messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SKuipers committed May 13, 2024
1 parent 14cf74a commit b2b1181
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
18 changes: 10 additions & 8 deletions modules/Messenger/messenger_manage_editProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,9 @@
exit;
}

// Check for any emojis in the message
// Check for any emojis in the message and remove them
$containsEmoji = hasEmojis($data['body']);

// Remove any emojis from the message
if($containsEmoji) {
if ($containsEmoji) {
$data['body'] = removeEmoji($data['body']);
}

Expand Down Expand Up @@ -155,7 +153,7 @@
exit;
}

if($containsEmoji) {
if ($containsEmoji) {
$URLSend .= '&return=warning3';
}

Expand All @@ -169,9 +167,13 @@
$messengerTargetGateway->deleteWhere(['gibbonMessengerID' => $gibbonMessengerID]);
$messageTargets->createMessageTargets($gibbonMessengerID, $partialFail);

$URL .= $partialFail
? "&return=error4"
: "&return=success0";
if ($partialFail) {
$URL .= '&return=error4';
} else {
$URL .= $containsEmoji
? "&return=warning3"
: "&return=success0";
}

header("Location: {$URL}");
}
16 changes: 9 additions & 7 deletions modules/Messenger/messenger_postProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@
exit;
}

// Check for any emojis in the message
// Check for any emojis in the message and remove them
$containsEmoji = hasEmojis($data['body']);

// Remove any emojis from the message
if($containsEmoji) {
$data['body'] = removeEmoji($data['body']);
}
Expand Down Expand Up @@ -117,7 +115,7 @@
exit;
}

if($containsEmoji) {
if ($containsEmoji) {
$URLSend .= '&return=warning3';
}

Expand All @@ -130,9 +128,13 @@
// Otherwise save any edits to targets
$messageTargets->createMessageTargets($gibbonMessengerID, $partialFail);

$URLEdit .= $partialFail
? "&return=warning1"
: "&return=success0";
if ($partialFail) {
$URLEdit .= '&return=warning1';
} else {
$URLEdit .= $containsEmoji
? "&return=warning3"
: "&return=success0";
}

header("Location: {$URLEdit}") ;
}
15 changes: 6 additions & 9 deletions modules/Messenger/messenger_postQuickWallProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,9 @@
$subject = $_POST['subject'] ?? '';
$body = stripslashes($_POST['body'] ?? '');

//check for any emojis in the message
// Check for any emojis in the message and remove them
$containsEmoji = hasEmojis($body);

//remove any emojis from the message
if($containsEmoji) {
if ($containsEmoji) {
$body = removeEmoji($body);
}

Expand Down Expand Up @@ -114,13 +112,12 @@
if ($partialFail == true) {
$URL .= '&return=warning1';
header("Location: {$URL}");
}else if($containsEmoji) {
$URL .= '&return=warning3';
header("Location: {$URL}");
} else {
//Success 0
$session->set('pageLoads', null);
$URL .= "&return=success0&editID=$AI";
$URL .= $containsEmoji
? "&return=warning3"
: "&return=success0&editID=$AI";

header("Location: {$URL}");
}
}
Expand Down

0 comments on commit b2b1181

Please sign in to comment.