Skip to content

Commit 678f2f6

Browse files
Save Telegram and Mastodon post sharing logs
1 parent 4656e9c commit 678f2f6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

includes/admin/services/class-rop-mastodon-service.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,15 @@ public function share( $post_details, $args = array() ) {
799799
$response = $this->request_new_post( $new_post );
800800

801801
if ( isset( $response->id ) ) {
802+
// Save log.
803+
$this->save_logs_on_rop(
804+
array(
805+
'network' => $post_details['service'],
806+
'handle' => $args['user'],
807+
'content' => $post_details['content'],
808+
'link' => $post_details['post_url'],
809+
)
810+
);
802811
$this->logger->alert_success(
803812
sprintf(
804813
'Successfully shared %s to %s on %s ',

includes/admin/services/class-rop-telegram-service.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,15 @@ public function share( $post_details, $args = array() ) {
423423
}
424424

425425
if ( $response && $response->getMessageId() ) {
426+
// Save log.
427+
$this->save_logs_on_rop(
428+
array(
429+
'network' => $post_details['service'],
430+
'handle' => $args['user'],
431+
'content' => $post_details['content'],
432+
'link' => $post_details['post_url'],
433+
)
434+
);
426435
$this->logger->alert_success(
427436
sprintf(
428437
'Successfully shared %s to %s on Telegram ',

0 commit comments

Comments
 (0)