mirror of https://gitlab.com/brutaldon/brutaldon
Compare commits
22 Commits
Author | SHA1 | Date |
---|---|---|
Dorian Vertumna | 28aae9942a | |
Dorian Wood | e03144c2e9 | |
DJ Sundog | 9768c08466 | |
David Quick | fdfb7bb93e | |
DJ Sundog | b9e064967c | |
franklint | 397306a8d9 | |
DJ Sundog | 8b147bbc16 | |
DJ Sundog | 19b4e56007 | |
Zachery Bohon | 2131b9da3f | |
Zac Bohon | badd8922fb | |
Zac Bohon | cdc199532d | |
DJ Sundog | 6d7d8d936a | |
Zac Bohon | 06d306ce2b | |
DJ Sundog | 13761e6125 | |
Zac Bohon | 287e2fc19c | |
Zac Bohon | 9981d0ff38 | |
DJ Sundog | 5f97d9fccd | |
DJ Sundog | 38904d4628 | |
Zachery Bohon | 11df272d5d | |
Zachery Bohon | 0b51f6b390 | |
DJ Sundog | ba0d0f2df0 | |
Jason McBrayer | e6c5273a2f |
|
@ -0,0 +1,56 @@
|
|||
# This file is a template, and might need editing before it works on your project.
|
||||
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
||||
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
||||
# This specific template is located at:
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Django.gitlab-ci.yml
|
||||
|
||||
# Official framework image. Look for the different tagged releases at:
|
||||
# https://hub.docker.com/r/library/python
|
||||
image: python:latest
|
||||
|
||||
# Pick zero or more services to be used on all builds.
|
||||
# Only needed when using a docker container to run your tests in.
|
||||
# Check out: http://docs.gitlab.com/ee/ci/docker/using_docker_images.html#what-is-a-service
|
||||
services:
|
||||
# - mysql:latest
|
||||
# - postgres:latest
|
||||
|
||||
variables:
|
||||
# POSTGRES_DB: database_name
|
||||
|
||||
# This folder is cached between builds
|
||||
# https://docs.gitlab.com/ee/ci/yaml/index.html#cache
|
||||
cache:
|
||||
paths:
|
||||
- ~/.cache/pip/
|
||||
|
||||
# This is a basic example for a gem or script which doesn't use
|
||||
# services such as redis or postgres
|
||||
before_script:
|
||||
- python -V # Print out python version for debugging
|
||||
# Uncomment next line if your Django app needs a JS runtime:
|
||||
# - apt-get update -q && apt-get install nodejs -yqq
|
||||
- pip install pipenv
|
||||
- pipenv install
|
||||
|
||||
# To get Django tests to work you may need to create a settings file using
|
||||
# the following DATABASES:
|
||||
#
|
||||
# DATABASES = {
|
||||
# 'default': {
|
||||
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||
# 'NAME': 'ci',
|
||||
# 'USER': 'postgres',
|
||||
# 'PASSWORD': 'postgres',
|
||||
# 'HOST': 'postgres',
|
||||
# 'PORT': '5432',
|
||||
# },
|
||||
# }
|
||||
#
|
||||
# and then adding `--settings app.settings.ci` (or similar) to the test command
|
||||
|
||||
test:
|
||||
variables:
|
||||
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
|
||||
script:
|
||||
- pipenv run python manage.py test
|
|
@ -0,0 +1,46 @@
|
|||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at sundog@reclaim.technology. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
|
@ -0,0 +1,29 @@
|
|||
Contributing
|
||||
============
|
||||
|
||||
Thank you for considering contributing to Brutaldon
|
||||
|
||||
You can contribute in the following ways:
|
||||
|
||||
- Finding and reporting bugs
|
||||
- Translating the Brutaldon interface into various languages
|
||||
- Contributing code to Brutaldon by fixing bugs or implementing features
|
||||
- Creating/improving the documentation
|
||||
|
||||
## Bug reports
|
||||
|
||||
Bug reports and feature suggestions must use descriptive and concise titles and be submitted to [GitLab Issues](https://gitlab.com/brutaldon/brutaldon/-/issues). Please use the search function to make sure that you are not submitting duplicates, and that a similar report or request has not already been resolved or rejected.
|
||||
|
||||
## Translations
|
||||
|
||||
We currently lack a formal process for this. Translations can be submitted via merge request to the gitlab repo.
|
||||
|
||||
## Merge requests
|
||||
|
||||
**Please use clean, concise titles for your merge requests.** Unless the merge request is about refactoring code, updating dependencies or other internal tasks, assume that the person reading the merge request title is not a programmer or Brutaldon developer, but instead a Brutaldon user or server administrator, and **try to describe your change or fix from their perspective**.
|
||||
|
||||
**The smaller the set of changes in the merge request is, the quicker it can be reviewed and merged.** Splitting tasks into multiple smaller merge requests is often preferable.
|
||||
|
||||
## Documentation
|
||||
|
||||
We would love assistance in creating a formal documentation process for this project.
|
4
Pipfile
4
Pipfile
|
@ -5,7 +5,7 @@ name = "pypi"
|
|||
|
||||
[packages]
|
||||
"beautifulsoup4" = "*"
|
||||
bleach = "*"
|
||||
bleach = "~=4.1"
|
||||
certifi = "*"
|
||||
chardet = "*"
|
||||
decorator = "*"
|
||||
|
@ -21,7 +21,7 @@ requests = "*"
|
|||
six = "*"
|
||||
"urllib3" = "*"
|
||||
webencodings = "*"
|
||||
Django = "*"
|
||||
Django = "~=3.2"
|
||||
django-html_sanitizer = "*"
|
||||
inscriptis = "*"
|
||||
lxml = "*"
|
||||
|
|
13
README.md
13
README.md
|
@ -1,6 +1,6 @@
|
|||
# Brutaldon
|
||||
|
||||
Note: If you are seeing this on Github, this repo is a mirror that may not be up-to-date. Please go to https://git.carcosa.net/jmcbray/brutaldon for the latest code.
|
||||
Note: If you are seeing this on Github, this repo is a mirror that may not be up-to-date. Please go to https://gitlab.com/brutaldon/brutaldon for the latest code.
|
||||
|
||||
Brutaldon is a [brutalist][0], [Web 1.0][0.5] web interface for [Mastodon][1] and [Pleroma][p]. It is not a Mastodon-compatible social networking server; rather, it is just a client, like the Android or iOS client for Mastodon you may already be using, but it runs in a web server, and is accessed through a web browser. It works great in text-mode browsers such as [Lynx][2], [w3m][3], or [elinks][4], and also in more heavy-weight graphical browsers, such as Firefox. It works completely without JavaScript, but if JavaScript is available and enabled, it will be used to unobtrusively enhance the user experience.
|
||||
|
||||
|
@ -12,11 +12,11 @@ Brutaldon is a [brutalist][0], [Web 1.0][0.5] web interface for [Mastodon][1] an
|
|||
[4]: http://elinks.or.cz/
|
||||
[p]: https://pleroma.social/
|
||||
|
||||
There is a hosted instance at [brutaldon.online][hosted] which you can use to log in to any instance. However, you are also encouraged to run your own, either locally or on a public server.
|
||||
There is a hosted instance at [brutaldon.org][hosted] which you can use to log in to any instance. However, you are also encouraged to run your own, either locally or on a public server.
|
||||
|
||||
[hosted]: https://brutaldon.online/
|
||||
[hosted]: https://brutaldon.org/
|
||||
|
||||
Brutaldon is ready for day to day use, and is my main way of interacting with the fediverse. It is still missing some features you might want, like lists, filters, and editing your own profile.
|
||||
Brutaldon is ready for day to day use. It is still missing some features you might want, like lists, filters, and editing your own profile.
|
||||
Please see the issues tracker.
|
||||
|
||||
## Screenshots
|
||||
|
@ -66,8 +66,3 @@ People love screenshots, whatever the project, so here we are. These screenshots
|
|||
## Aesthetic
|
||||
|
||||
No automatic page updates: refresh the page to see new toots. No endless scroll: there's a "next page" link. No autocompletion of anything: use another lynx process in another screen window to look things up. UTF8 clean.
|
||||
|
||||
## Tip Jar
|
||||
|
||||
You can buy me a coffee to give me energy to work on this, but only if you have it to spare.
|
||||
[![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/D1D7QBZC)
|
||||
|
|
|
@ -211,5 +211,8 @@ def CHECK_INSTANCE_URL(url, redirect):
|
|||
return redirect(RICKROLL_URL)
|
||||
|
||||
|
||||
# See https://dev.to/weplayinternet/upgrading-to-django-3-2-and-fixing-defaultautofield-warnings-518n
|
||||
DEFAULT_AUTO_FIELD='django.db.models.AutoField'
|
||||
|
||||
# Version number displayed on about page
|
||||
BRUTALDON_VERSION = "2.14.1"
|
||||
BRUTALDON_VERSION = "2.15.0"
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<a class="level-item is-size-7" href="/about">
|
||||
About
|
||||
</a>
|
||||
<a class="level-item is-size-7" href="https://github.com/jfmcbrayer/brutaldon">
|
||||
<a class="level-item is-size-7" href="https://gitlab.com/brutaldon/brutaldon">
|
||||
Source
|
||||
</a>
|
||||
</div>
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
<div class="container">
|
||||
{% block content %}
|
||||
<h1 class="title">
|
||||
Title
|
||||
Brutaldon
|
||||
</h1>
|
||||
<p class="subtitle">
|
||||
Brutaldon is totally a thing.
|
||||
|
@ -180,7 +180,7 @@
|
|||
<a class="level-item is-size-7" href="{% url "about" %}">
|
||||
About
|
||||
</a>
|
||||
<a class="level-item is-size-7" href="https://github.com/jfmcbrayer/brutaldon">
|
||||
<a class="level-item is-size-7" href="https://gitlab.com/brutaldon/brutaldon">
|
||||
Source
|
||||
</a>
|
||||
<span class="level-item is-size-7" >Bookmarklet: <a href="{{ bookmarklet_url }}">Share via brutaldon</a></span>
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
{% block pagination %}
|
||||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<a class="pagination-next" href="{% url 'local_prev' prev.min_id %}">Newer</a>
|
||||
<a class="pagination-next" rel="next" href="{% url 'local_prev' prev.min_id %}">Newer</a>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
<a class="pagination-previous" href="{% url 'local_next' next.max_id %}">Older</a>
|
||||
<a class="pagination-previous" rel="prev" href="{% url 'local_next' next.max_id %}">Older</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
|
|
@ -109,10 +109,10 @@ mastodon.notifications()[0]
|
|||
|
||||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<a class="pagination-next" href="{% url 'note_prev' prev.min_id %}">Newer</a>
|
||||
<a class="pagination-next" rel="next" href="{% url 'note_prev' prev.min_id %}">Newer</a>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
<a class="pagination-previous" href="{% url 'note_next' next.max_id %}">Older</a>
|
||||
<a class="pagination-previous" rel="prev" href="{% url 'note_next' next.max_id %}">Older</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
{% block pagination %}
|
||||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<a class="pagination-next" href="{% url 'fed_prev' prev.min_id %}">Newer</a>
|
||||
<a class="pagination-next" rel="next" href="{% url 'fed_prev' prev.min_id %}">Newer</a>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
<a class="pagination-previous" href="{% url 'fed_next' next.max_id %}">Older</a>
|
||||
<a class="pagination-previous" rel="prev" href="{% url 'fed_next' next.max_id %}">Older</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
|
|
@ -14,14 +14,15 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Brutaldon ({{ own_acct.username }}) - {{ timeline_name }} timelime</h1>
|
||||
{% if form %}
|
||||
<h1 class="title">Post</h1>
|
||||
<h2 class="title">Post</h2>
|
||||
<div class="box">
|
||||
{% include "main/post_minimal_partial.html" %}
|
||||
</div>
|
||||
<hr class="is-hidden">
|
||||
{% endif %}
|
||||
<h1 class="title">Your {{ timeline_name }} timeline</h1>
|
||||
<h2 class="title">Your {{ timeline_name }} timeline</h2>
|
||||
<div id="timeline">
|
||||
{% for toot in toots %}
|
||||
{% cache 600 toot_partial toot.id %}
|
||||
|
@ -40,6 +41,7 @@
|
|||
{% if next %}
|
||||
<p class="column is-one-quarter">
|
||||
<a class="pagination-previous is-fullwidth button"
|
||||
rel="prev"
|
||||
href="{% url 'home_next' next.max_id %}"
|
||||
{% if preferences.click_to_load %}
|
||||
ic-get-from="{% url 'home_next' next.max_id %}"
|
||||
|
@ -57,6 +59,7 @@
|
|||
{% if prev %}
|
||||
<p class="column is-one-quarter">
|
||||
<a class="pagination-next is-fullwidth button"
|
||||
rel="next"
|
||||
href="{% url 'home_prev' prev.min_id %}">
|
||||
Newer
|
||||
</a>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<div class="media-content">
|
||||
<div class="content">
|
||||
<p>
|
||||
<strong>{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}</strong>
|
||||
<h3><strong>{{ toot.account.display_name | fix_emojos:toot.account.emojis | strip_html |safe}}</strong></h3>
|
||||
<small><a href="{% url "user" toot.account.acct %}">
|
||||
@{{ toot.account.acct }}</a></small>
|
||||
<a href="{{ toot.url }}">
|
||||
|
@ -214,7 +214,11 @@
|
|||
delete
|
||||
</a>
|
||||
{% endif %}
|
||||
{{ toot.visibility }}
|
||||
{% if toot.local_only %}
|
||||
{{ toot.visibility }} (local-only)
|
||||
{% else %}
|
||||
{{ toot.visibility }}
|
||||
{% endif %}
|
||||
|
||||
{% if toot.in_reply_to_id or toot.replies_count > 0 %}
|
||||
<a class="level-item" href="{% url "thread" toot.id %}#toot-{{ toot.id }}">
|
||||
|
|
|
@ -120,10 +120,10 @@ Brutaldon ({{ own_acct.username }}) - {{ user.acct }} timelime
|
|||
{% endfor %}
|
||||
<nav class="pagination is-centered" role="navigation" aria-label="pagination">
|
||||
{% if prev %}
|
||||
<a class="pagination-next" href="{% url 'user_prev' user.acct prev.min_id %}">Newer</a>
|
||||
<a class="pagination-next" rel="next" href="{% url 'user_prev' user.acct prev.min_id %}">Newer</a>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
<a class="pagination-previous" href="{% url 'user_next' user.acct next.max_id %}">Older</a>
|
||||
<a class="pagination-previous" rel="prev" href="{% url 'user_next' user.acct next.max_id %}">Older</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
|
|
|
@ -92,6 +92,7 @@ def get_usercontext(request, feature_set="mainline"):
|
|||
session=get_session(client.api_base_id),
|
||||
ratelimit_method="throw",
|
||||
feature_set=feature_set,
|
||||
version_check_mode='none',
|
||||
)
|
||||
return user, mastodon
|
||||
else:
|
||||
|
@ -105,6 +106,7 @@ def is_logged_in(request):
|
|||
def _notes_count(account, mastodon):
|
||||
if not mastodon:
|
||||
return ""
|
||||
mastodon.version_check_mode = 'none'
|
||||
notes = mastodon.notifications(limit=40)
|
||||
if account.preferences.filter_notifications:
|
||||
notes = [
|
||||
|
@ -182,6 +184,7 @@ def user_search(request):
|
|||
|
||||
def user_search_inner(request, query):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
results = mastodon.search(query)
|
||||
return render(
|
||||
request,
|
||||
|
@ -208,6 +211,7 @@ def timeline(
|
|||
filter_context="home",
|
||||
):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
data = mastodon.timeline(timeline, limit=40, max_id=max_id, min_id=min_id)
|
||||
form = PostForm(
|
||||
initial={"visibility": request.session["active_user"].source.privacy}
|
||||
|
@ -257,6 +261,7 @@ def timeline(
|
|||
|
||||
def get_filters(mastodon, context=None):
|
||||
try:
|
||||
mastodon.version_check_mode = 'none'
|
||||
if context:
|
||||
return [ff for ff in mastodon.filters() if context in ff.context]
|
||||
else:
|
||||
|
@ -341,6 +346,7 @@ def forget_account(request, account_name):
|
|||
|
||||
def notes_count(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
count = _notes_count(account, mastodon)
|
||||
return render(
|
||||
request,
|
||||
|
@ -372,6 +378,7 @@ def tag(request, tag):
|
|||
account, mastodon = get_usercontext(request)
|
||||
except NotLoggedInException:
|
||||
return redirect(login)
|
||||
mastodon.version_check_mode = 'none'
|
||||
data = mastodon.timeline_hashtag(tag)
|
||||
notifications = _notes_count(account, mastodon)
|
||||
return render(
|
||||
|
@ -438,6 +445,7 @@ def login(request):
|
|||
client_id=client.client_id,
|
||||
client_secret=client.client_secret,
|
||||
api_base_url=api_base_url,
|
||||
version_check_mode='none',
|
||||
)
|
||||
client.version = mastodon.instance().get("version")
|
||||
client.save()
|
||||
|
@ -460,6 +468,7 @@ def oauth_callback(request):
|
|||
client_id=request.session["active_client_id"],
|
||||
client_secret=request.session["active_client_secret"],
|
||||
api_base_url=request.session["active_instance"],
|
||||
version_check_mode="none",
|
||||
)
|
||||
redirect_uri = request.build_absolute_uri(reverse("oauth_callback"))
|
||||
access_token = mastodon.log_in(
|
||||
|
@ -467,6 +476,7 @@ def oauth_callback(request):
|
|||
)
|
||||
request.session["access_token"] = access_token
|
||||
user = mastodon.account_verify_credentials()
|
||||
|
||||
try:
|
||||
account = Account.objects.get(
|
||||
username=user.username + "@" + request.session["active_instance_hostname"]
|
||||
|
@ -615,6 +625,7 @@ def note(request, next=None, prev=None):
|
|||
account, mastodon = get_usercontext(request)
|
||||
except NotLoggedInException:
|
||||
return redirect(about)
|
||||
mastodon.version_check_mode = 'none'
|
||||
try:
|
||||
last_seen = mastodon.notifications(limit=1)[0]
|
||||
except IndexError:
|
||||
|
@ -740,6 +751,7 @@ def user(request, username, prev=None, next=None):
|
|||
except NotLoggedInException:
|
||||
return redirect(about)
|
||||
user_dict = None
|
||||
mastodon.version_check_mode = 'none'
|
||||
# pleroma currently flops if the user's not already locally known
|
||||
# this is a BUG that they MUST FIX
|
||||
# but until then, we might have to fallback to a regular search,
|
||||
|
@ -855,6 +867,7 @@ def status_post(account, request, mastodon, **kw):
|
|||
@br_login_required
|
||||
def toot(request, mention=None):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.method == "GET":
|
||||
if mention:
|
||||
if not mention.startswith("@"):
|
||||
|
@ -960,6 +973,7 @@ def toot(request, mention=None):
|
|||
def redraft(request, id):
|
||||
if request.method == "GET":
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
toot_content = get_text(toot.content) # convert to plain text
|
||||
# fix up white space
|
||||
|
@ -995,6 +1009,7 @@ def redraft(request, id):
|
|||
elif request.method == "POST":
|
||||
form = PostForm(request.POST, request.FILES)
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
if form.is_valid():
|
||||
media_objects = []
|
||||
|
@ -1081,6 +1096,7 @@ def safe_get_attachment(toot, index):
|
|||
def reply(request, id):
|
||||
if request.method == "GET":
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
try:
|
||||
toot = mastodon.status(id)
|
||||
context = mastodon.status_context(id)
|
||||
|
@ -1199,6 +1215,7 @@ def reply(request, id):
|
|||
@br_login_required
|
||||
def share(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.method == "GET":
|
||||
params = request.GET
|
||||
if request.method == "POST":
|
||||
|
@ -1231,6 +1248,7 @@ def share(request):
|
|||
@br_login_required
|
||||
def fav(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
if request.method == "POST":
|
||||
if not request.POST.get("cancel", None):
|
||||
|
@ -1270,6 +1288,7 @@ def fav(request, id):
|
|||
@br_login_required
|
||||
def boost(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
if request.method == "POST":
|
||||
if not request.POST.get("cancel", None):
|
||||
|
@ -1309,6 +1328,7 @@ def boost(request, id):
|
|||
@br_login_required
|
||||
def delete(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
if request.method == "POST" or request.method == "DELETE":
|
||||
if toot.account.acct != request.session["active_user"].acct:
|
||||
|
@ -1335,6 +1355,7 @@ def delete(request, id):
|
|||
@br_login_required
|
||||
def follow(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
try:
|
||||
user_dict = mastodon.account(id)
|
||||
relationship = mastodon.account_relationships(user_dict.id)[0]
|
||||
|
@ -1381,6 +1402,7 @@ def follow(request, id):
|
|||
@br_login_required
|
||||
def block(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
try:
|
||||
user_dict = mastodon.account(id)
|
||||
relationship = mastodon.account_relationships(user_dict.id)[0]
|
||||
|
@ -1419,6 +1441,7 @@ def block(request, id):
|
|||
@br_login_required
|
||||
def mute(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
try:
|
||||
user_dict = mastodon.account(id)
|
||||
relationship = mastodon.account_relationships(user_dict.id)[0]
|
||||
|
@ -1456,6 +1479,7 @@ def mute(request, id):
|
|||
@br_login_required
|
||||
def search(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.GET.get("ic-request"):
|
||||
return render(
|
||||
request,
|
||||
|
@ -1487,6 +1511,7 @@ def search_results(request):
|
|||
query = ""
|
||||
account, mastodon = get_usercontext(request)
|
||||
|
||||
mastodon.version_check_mode = 'none'
|
||||
results = mastodon.search(query)
|
||||
notifications = _notes_count(account, mastodon)
|
||||
return render(
|
||||
|
@ -1523,6 +1548,7 @@ def about(request):
|
|||
@cache_page(60 * 30)
|
||||
def privacy(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if account:
|
||||
preferences = account.preferences
|
||||
else:
|
||||
|
@ -1541,6 +1567,7 @@ def privacy(request):
|
|||
@br_login_required
|
||||
def emoji_reference(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
emojos = mastodon.custom_emojis()
|
||||
notifications = _notes_count(account, mastodon)
|
||||
return render(
|
||||
|
@ -1558,6 +1585,7 @@ def emoji_reference(request):
|
|||
@br_login_required
|
||||
def list_filters(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
filters = mastodon.filters()
|
||||
return render(
|
||||
request,
|
||||
|
@ -1569,6 +1597,7 @@ def list_filters(request):
|
|||
@br_login_required
|
||||
def create_filter(request):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.method == "POST":
|
||||
form = FilterForm(request.POST)
|
||||
if form.is_valid():
|
||||
|
@ -1609,6 +1638,7 @@ def create_filter(request):
|
|||
@br_login_required
|
||||
def delete_filter(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
filter = mastodon.filter(id)
|
||||
|
||||
if request.method == "POST" or request.method == "DELETE":
|
||||
|
@ -1633,6 +1663,7 @@ def delete_filter(request, id):
|
|||
@br_login_required
|
||||
def edit_filter(request, id):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
filter = mastodon.filter(id)
|
||||
|
||||
contexts = []
|
||||
|
@ -1696,6 +1727,7 @@ def edit_filter(request, id):
|
|||
@br_login_required
|
||||
def follow_requests(request, id=None):
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.method == "GET":
|
||||
reqs = mastodon.follow_requests()
|
||||
return render(
|
||||
|
@ -1716,6 +1748,7 @@ def follow_requests(request, id=None):
|
|||
@br_login_required
|
||||
def accounts(request, id=None):
|
||||
active_account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
if request.method == "GET":
|
||||
accounts = [x for x in request.session.get("accounts_dict").values()]
|
||||
return render(
|
||||
|
@ -1758,6 +1791,7 @@ def vote(request, id):
|
|||
return redirect("thread", id)
|
||||
if request.method == "POST":
|
||||
account, mastodon = get_usercontext(request)
|
||||
mastodon.version_check_mode = 'none'
|
||||
toot = mastodon.status(id)
|
||||
poll = toot.poll
|
||||
if not poll:
|
||||
|
|
Loading…
Reference in New Issue