diff --git a/src/hooks/forgejo.rs b/src/hooks/forgejo.rs
index c31d719..4929411 100644
--- a/src/hooks/forgejo.rs
+++ b/src/hooks/forgejo.rs
@@ -13,10 +13,36 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-use crate::hooks::types::{Commit, Hook, Push, Repository, User};
+use crate::hooks::types::{Commit, Hook, Issue, IssueAction, Push, Repository, User};
use crate::Error;
-pub use ::forgejo_hooks::Hook as ForgejoHook;
+pub use ::forgejo_hooks::{Hook as ForgejoHook, Issue as FjIssue, IssueAction as FjIssueAction};
+
+impl From for IssueAction {
+ fn from(other: FjIssueAction) -> IssueAction {
+ match other {
+ FjIssueAction::Opened => IssueAction::Open,
+ FjIssueAction::Edited => IssueAction::Update,
+ }
+ }
+}
+
+impl From for Issue {
+ fn from(other: FjIssue) -> Issue {
+ Issue {
+ id: other.number,
+ action: Some(other.action.into()),
+ title: other.issue.title,
+ author: User {
+ name: other.issue.user.login,
+ },
+ repository: Repository {
+ name: other.repository.name,
+ },
+ url: None,
+ }
+ }
+}
impl TryFrom for Hook {
type Error = Error;
@@ -42,6 +68,7 @@ impl TryFrom for Hook {
name: push.pusher.username,
},
}),
+ ForgejoHook::Issue(issue) => Hook::Issue(issue.into()),
_ => return Err(Error::UnsupportedHookConversion),
})
}