Skip to content

Commit

Permalink
Save Telegram and Mastodon post sharing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
girishpanchal30 committed Feb 10, 2025
1 parent 4656e9c commit 678f2f6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/admin/services/class-rop-mastodon-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,15 @@ public function share( $post_details, $args = array() ) {
$response = $this->request_new_post( $new_post );

if ( isset( $response->id ) ) {
// Save log.
$this->save_logs_on_rop(
array(
'network' => $post_details['service'],
'handle' => $args['user'],
'content' => $post_details['content'],
'link' => $post_details['post_url'],
)
);
$this->logger->alert_success(
sprintf(
'Successfully shared %s to %s on %s ',
Expand Down
9 changes: 9 additions & 0 deletions includes/admin/services/class-rop-telegram-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,15 @@ public function share( $post_details, $args = array() ) {
}

if ( $response && $response->getMessageId() ) {
// Save log.
$this->save_logs_on_rop(
array(
'network' => $post_details['service'],
'handle' => $args['user'],
'content' => $post_details['content'],
'link' => $post_details['post_url'],
)
);
$this->logger->alert_success(
sprintf(
'Successfully shared %s to %s on Telegram ',
Expand Down

0 comments on commit 678f2f6

Please sign in to comment.