By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
This refactors the globals in olm/olm.go into a struct with all the required state for an Olm client connection.
It also moves websocket handlers into separate, more organized files, instead of defining all handlers in a single method with lots of nested indentation, and adds nil checks in many other places that would have otherwise resulted in panics.
Requires #74 to be merged into dev beforehand, and then the branch base can be changed afterwards.
How to test?
No observable changes in behavior should exist.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/fosrl/olm/pull/75
**Author:** [@water-sucks](https://github.com/water-sucks)
**Created:** 1/10/2026
**Status:** ✅ Merged
**Merged:** 1/14/2026
**Merged by:** [@oschwartz10612](https://github.com/oschwartz10612)
**Base:** `dev` ← **Head:** `stop-with-the-globals-omg`
---
### 📝 Commits (1)
- [`555400f`](https://github.com/fosrl/olm/commit/555400ff686497e677bfc2c60de2bf59c08e2e11) refactor(olm): convert global state into an olm instance
### 📊 Changes
**8 files changed** (+841 additions, -799 deletions)
<details>
<summary>View changed files</summary>
📝 `api/api.go` (+16 -13)
📝 `main.go` (+8 -4)
➕ `olm/connect.go` (+223 -0)
➕ `olm/data.go` (+197 -0)
📝 `olm/olm.go` (+198 -778)
➕ `olm/peer.go` (+195 -0)
📝 `olm/ping.go` (+3 -3)
📝 `olm/types.go` (+1 -1)
</details>
### 📄 Description
## Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
## Description
This refactors the globals in `olm/olm.go` into a struct with all the required state for an Olm client connection.
It also moves websocket handlers into separate, more organized files, instead of defining all handlers in a single method with lots of nested indentation, and adds nil checks in many other places that would have otherwise resulted in panics.
Requires #74 to be merged into `dev` beforehand, and then the branch base can be changed afterwards.
## How to test?
No observable changes in behavior should exist.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/fosrl/olm/pull/75
Author: @water-sucks
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/14/2026
Merged by: @oschwartz10612
Base:
dev← Head:stop-with-the-globals-omg📝 Commits (1)
555400frefactor(olm): convert global state into an olm instance📊 Changes
8 files changed (+841 additions, -799 deletions)
View changed files
📝
api/api.go(+16 -13)📝
main.go(+8 -4)➕
olm/connect.go(+223 -0)➕
olm/data.go(+197 -0)📝
olm/olm.go(+198 -778)➕
olm/peer.go(+195 -0)📝
olm/ping.go(+3 -3)📝
olm/types.go(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
This refactors the globals in
olm/olm.gointo a struct with all the required state for an Olm client connection.It also moves websocket handlers into separate, more organized files, instead of defining all handlers in a single method with lots of nested indentation, and adds nil checks in many other places that would have otherwise resulted in panics.
Requires #74 to be merged into
devbeforehand, and then the branch base can be changed afterwards.How to test?
No observable changes in behavior should exist.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.