mirror of https://codeberg.org/cage/tinmop/
- implemented a minimal 9p client.
This commit is contained in:
parent
a8ff325e9d
commit
8d2d411f14
|
@ -0,0 +1,32 @@
|
|||
(in-package :9p-client)
|
||||
|
||||
(define-condition 9p-error (error)
|
||||
((error-value
|
||||
:initarg :error-value
|
||||
:reader error-value)
|
||||
(message-type
|
||||
:initarg :message-type
|
||||
:reader message-type)
|
||||
(tag
|
||||
:initarg :tag
|
||||
:reader tag))
|
||||
(:report (lambda (condition stream)
|
||||
(format stream
|
||||
"message-type ~a tag ~a: ~a"
|
||||
(message-type condition)
|
||||
(tag condition)
|
||||
(error-value condition))))
|
||||
(:documentation "Error for 9p protocol"))
|
||||
|
||||
|
||||
(define-condition 9p-initialization-error (error)
|
||||
((tag
|
||||
:initarg :tag
|
||||
:reader tag)
|
||||
(rtag
|
||||
:initarg :rtag
|
||||
:reader rtag))
|
||||
(:report (lambda (condition stream)
|
||||
(format stream "error initialization tag sent ~a, got ~a instead"
|
||||
(tag condition) (rtag condition))))
|
||||
(:documentation "Error for 9p protocol"))
|
|
@ -0,0 +1,53 @@
|
|||
(in-package :9p-client)
|
||||
|
||||
(defparameter *tversion* 100)
|
||||
|
||||
(defparameter *rversion* 101)
|
||||
|
||||
(defparameter *tauth* 102)
|
||||
|
||||
(defparameter *rauth* 103)
|
||||
|
||||
(defparameter *tattach* 104)
|
||||
|
||||
(defparameter *rattach* 105)
|
||||
|
||||
(defparameter *terror* 106) ; there is no terror
|
||||
|
||||
(defparameter *rerror* 107)
|
||||
|
||||
(defparameter *tflush* 108)
|
||||
|
||||
(defparameter *rflush* 108)
|
||||
|
||||
(defparameter *twalk* 110)
|
||||
|
||||
(defparameter *rwalk* 109)
|
||||
|
||||
(defparameter *topen* 112)
|
||||
|
||||
(defparameter *ropen* 113)
|
||||
|
||||
(defparameter *tcreate* 114)
|
||||
|
||||
(defparameter *rcreate* 115)
|
||||
|
||||
(defparameter *tread* 116)
|
||||
|
||||
(defparameter *rread* 117)
|
||||
|
||||
(defparameter *twrite* 118)
|
||||
|
||||
(defparameter *rwrite* 119)
|
||||
|
||||
(defparameter *tclunk* 120)
|
||||
|
||||
(defparameter *rclunk* 121)
|
||||
|
||||
(defparameter *tremove* 122)
|
||||
|
||||
(defparameter *rremove* 123)
|
||||
|
||||
(defparameter *tstat* 124)
|
||||
|
||||
(defparameter *rstat* 125)
|
|
@ -0,0 +1,21 @@
|
|||
;; tinmop: an humble gemini and pleroma client
|
||||
;; Copyright (C) 2020 cage
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation, either version 3 of the License, or
|
||||
;; (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
(defpackage :9p-client
|
||||
(:use
|
||||
:cl
|
||||
:alexandria)
|
||||
(:export))
|
|
@ -472,9 +472,9 @@ database."
|
|||
:spoiler-text subject
|
||||
:visibility visibility))
|
||||
|
||||
(defun-api-call search-user (username &key (limit 1))
|
||||
(defun-api-call search-user (username &key (limit 1) (resolve nil))
|
||||
"Find user identified by username"
|
||||
(tooter:search-accounts *client* username :limit limit))
|
||||
(tooter:search-accounts *client* username :limit limit :resolve resolve))
|
||||
|
||||
(defun-api-call follow-user (user-id)
|
||||
"Follow user identified by user-id"
|
||||
|
|
|
@ -732,7 +732,8 @@
|
|||
(string= (tooter:account-name a)
|
||||
username))
|
||||
remote-accounts-matching)))
|
||||
(tooter:id matched-account)))
|
||||
(values (tooter:id matched-account)
|
||||
username)))
|
||||
|
||||
(defmacro with-process-follower ((username user-id
|
||||
&optional (local-complete-username-fn #'db:all-unfollowed-usernames))
|
||||
|
|
|
@ -84,6 +84,11 @@
|
|||
(:file "emoji-shortcodes")
|
||||
(:file "software-configuration")
|
||||
(:file "tui-utils")
|
||||
(:module 9p-client
|
||||
:components ((:file "package")
|
||||
(:file "message-types")
|
||||
(:file "conditions")
|
||||
(:file "client")))
|
||||
(:module gemini
|
||||
:components ((:file "package")
|
||||
(:file "gemini-constants")
|
||||
|
|
Loading…
Reference in New Issue