Skip to content

Commit

Permalink
Update activitypub.extend.php
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Jul 7, 2022
1 parent 1726bd3 commit b23fa6a
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions extend/activitypub.extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// ActivityPub implementation for GNUBOARD 5
// Go Namhyeon <gnh1201@gmail.com>
// MIT License
// 2022-07-06 (version 0.1.11)
// 2022-07-06 (version 0.1.12)

// References:
// * https://www.w3.org/TR/activitypub/
Expand Down Expand Up @@ -362,7 +362,7 @@ function koreaexim_get_exchange_data() {
return $data;
}

function activitypub_publish_content($content, $id, $mb, $_added_object = array(), $_added_to = array()) {
function activitypub_publish_content($content, $object_id, $mb, $_added_object = array(), $_added_to = array()) {
// 위치정보를 사용하는 경우 모듈 로드
$location_ctx = array();
if (ACTIVITYPUB_ENABLED_GEOLOCATION) {
Expand Down Expand Up @@ -491,7 +491,7 @@ function activitypub_publish_content($content, $id, $mb, $_added_object = array(
$object = array(
"type" => "Note",
"generator" => "GNUBOARD5 ActivityPub Plugin (INSTANCE_ID: " . ACTIVITYPUB_INSTANCE_ID . ", INSTANCE_VERSION: " . ACTIVITYPUB_INSTANCE_VERSION . ")",
"id" => $id,
"id" => $object_id,
"attributedTo" => activitypub_get_url("user", array("mb_id" => $mb['mb_id'])),
"content" => $content,
"icon" => activitypub_get_icon($mb)
Expand Down Expand Up @@ -739,8 +739,11 @@ function activitypub_update_activity($inbox = "inbox", $data, $mb = array("mb_id
$sql = "update $write_table set wr_file = 1 where wr_id = '{$wr_id}'";
sql_query($sql);
}

// 상태 업데이트
$sql = "update $write_table set wr_8 = 'published' where wr_id = '$wr_id'";
sql_query($sql);
}


return $wr_id;
}
Expand Down Expand Up @@ -1184,7 +1187,6 @@ public static function close() {
}

// 훅(Hook) 등록

function _activitypub_memo_form_update_after($member_list, $str_nick_list, $redirect_url, $me_memo) {
global $member;

Expand Down Expand Up @@ -1270,6 +1272,13 @@ function _activitypub_comment_update_after($board, $wr_id, $w, $qstr, $redirect_
add_event("comment_update_after", "_activitypub_comment_update_after", 0, 7);
add_event("memo_form_update_after", "_activitypub_memo_form_update_after", 0, 4);

// 확장 라이브러리 가져오기 (*.activitypub.lib.php)
$tmp = dir(G5_LIB_PATH);
while ($entry = $tmp->read()) {
if (preg_match("/(\.activitypub\.lib\.php)$/i", $entry))
include(G5_LIB_PATH . "/" . $entry);
}

// 모든 준비가 완료되고 작업 시작
$route = $_GET['route'];

Expand Down

0 comments on commit b23fa6a

Please sign in to comment.