diff --git a/daemon.py b/daemon.py
index 26b7caf0d..b9ea77887 100644
--- a/daemon.py
+++ b/daemon.py
@@ -81,7 +81,6 @@ from posts import createBlogPost
from posts import createReportPost
from posts import createUnlistedPost
from posts import createFollowersOnlyPost
-from posts import createEventPost
from posts import createDirectMessagePost
from posts import populateRepliesJson
from posts import addToField
@@ -160,7 +159,6 @@ from webapp_person_options import htmlPersonOptions
from webapp_timeline import htmlShares
from webapp_timeline import htmlInbox
from webapp_timeline import htmlBookmarks
-from webapp_timeline import htmlEvents
from webapp_timeline import htmlInboxDMs
from webapp_timeline import htmlInboxReplies
from webapp_timeline import htmlInboxMedia
@@ -9043,138 +9041,6 @@ class PubServer(BaseHTTPRequestHandler):
self.server.GETbusy = False
return True
- def _showEventsTimeline(self, authorized: bool,
- callingDomain: str, path: str,
- baseDir: str, httpPrefix: str,
- domain: str, domainFull: str, port: int,
- onionDomain: str, i2pDomain: str,
- GETstartTime, GETtimings: {},
- proxyType: str, cookie: str,
- debug: str) -> bool:
- """Shows the events timeline
- """
- if '/users/' in path:
- if authorized:
- # convert /events to /tlevents
- if path.endswith('/events') or \
- '/events?page=' in path:
- path = path.replace('/events', '/tlevents')
- eventsFeed = \
- personBoxJson(self.server.recentPostsCache,
- self.server.session,
- baseDir,
- domain,
- port,
- path,
- httpPrefix,
- maxPostsInFeed, 'tlevents',
- authorized,
- 0, self.server.positiveVoting,
- self.server.votingTimeMins)
- print('eventsFeed: ' + str(eventsFeed))
- if eventsFeed:
- if self._requestHTTP():
- nickname = path.replace('/users/', '')
- nickname = nickname.replace('/tlevents', '')
- pageNumber = 1
- if '?page=' in nickname:
- pageNumber = nickname.split('?page=')[1]
- nickname = nickname.split('?page=')[0]
- if pageNumber.isdigit():
- pageNumber = int(pageNumber)
- else:
- pageNumber = 1
- if 'page=' not in path:
- # if no page was specified then show the first
- eventsFeed = \
- personBoxJson(self.server.recentPostsCache,
- self.server.session,
- baseDir,
- domain,
- port,
- path + '?page=1',
- httpPrefix,
- maxPostsInFeed,
- 'tlevents',
- authorized,
- 0, self.server.positiveVoting,
- self.server.votingTimeMins)
- fullWidthTimelineButtonHeader = \
- self.server.fullWidthTimelineButtonHeader
- minimalNick = isMinimal(baseDir, domain, nickname)
-
- accessKeys = self.server.accessKeys
- if self.server.keyShortcuts.get(nickname):
- accessKeys = \
- self.server.keyShortcuts[nickname]
-
- msg = \
- htmlEvents(self.server.cssCache,
- self.server.defaultTimeline,
- self.server.recentPostsCache,
- self.server.maxRecentPosts,
- self.server.translate,
- pageNumber, maxPostsInFeed,
- self.server.session,
- baseDir,
- self.server.cachedWebfingers,
- self.server.personCache,
- nickname,
- domain,
- port,
- eventsFeed,
- self.server.allowDeletion,
- httpPrefix,
- self.server.projectVersion,
- minimalNick,
- self.server.YTReplacementDomain,
- self.server.showPublishedDateOnly,
- self.server.newswire,
- self.server.positiveVoting,
- self.server.showPublishAsIcon,
- fullWidthTimelineButtonHeader,
- self.server.iconsAsButtons,
- self.server.rssIconAtTop,
- self.server.publishButtonAtTop,
- authorized,
- self.server.themeName,
- self.server.peertubeInstances,
- self.server.allowLocalNetworkAccess,
- self.server.textModeBanner,
- accessKeys)
- msg = msg.encode('utf-8')
- msglen = len(msg)
- self._set_headers('text/html', msglen,
- cookie, callingDomain)
- self._write(msg)
- self._benchmarkGETtimings(GETstartTime, GETtimings,
- 'show bookmarks 2 done',
- 'show events')
- else:
- # don't need authenticated fetch here because
- # there is already the authorization check
- msg = json.dumps(eventsFeed,
- ensure_ascii=False)
- msg = msg.encode('utf-8')
- msglen = len(msg)
- self._set_headers('application/json', msglen,
- None, callingDomain)
- self._write(msg)
- self.server.GETbusy = False
- return True
- else:
- if debug:
- nickname = path.replace('/users/', '')
- nickname = nickname.replace('/tlevents', '')
- print('DEBUG: ' + nickname +
- ' was not authorized to access ' + path)
- if debug:
- print('DEBUG: GET access to events is unauthorized')
- self.send_response(405)
- self.end_headers()
- self.server.GETbusy = False
- return True
-
def _showOutboxTimeline(self, authorized: bool,
callingDomain: str, path: str,
baseDir: str, httpPrefix: str,
@@ -10385,7 +10251,7 @@ class PubServer(BaseHTTPRequestHandler):
# Various types of new post in the web interface
newPostEnd = ('newpost', 'newblog', 'newunlisted',
'newfollowers', 'newdm', 'newreminder',
- 'newevent', 'newreport', 'newquestion',
+ 'newreport', 'newquestion',
'newshare')
for postType in newPostEnd:
if path.endswith('/' + postType):
@@ -10578,44 +10444,6 @@ class PubServer(BaseHTTPRequestHandler):
return True
return False
- def _editEvent(self, callingDomain: str, path: str,
- httpPrefix: str, domain: str, domainFull: str,
- baseDir: str, translate: {},
- mediaInstance: bool,
- cookie: str) -> bool:
- """Show edit event screen
- """
- messageId = path.split('?editeventpost=')[1]
- if '?' in messageId:
- messageId = messageId.split('?')[0]
- actor = path.split('?actor=')[1]
- if '?' in actor:
- actor = actor.split('?')[0]
- nickname = getNicknameFromActor(path)
- if nickname == actor:
- # postUrl = \
- # httpPrefix + '://' + \
- # domainFull + '/users/' + nickname + \
- # '/statuses/' + messageId
- msg = None
- # TODO
- # htmlEditEvent(mediaInstance,
- # translate,
- # baseDir,
- # httpPrefix,
- # path,
- # nickname, domain,
- # postUrl)
- if msg:
- msg = msg.encode('utf-8')
- msglen = len(msg)
- self._set_headers('text/html', msglen,
- cookie, callingDomain)
- self._write(msg)
- self.server.GETbusy = False
- return True
- return False
-
def _getFollowingJson(self, baseDir: str, path: str,
callingDomain: str,
httpPrefix: str,
@@ -12498,21 +12326,6 @@ class PubServer(BaseHTTPRequestHandler):
self.server.GETbusy = False
return
- # Edit an event
- if authorized and \
- '/tlevents' in self.path and \
- '?editeventpost=' in self.path and \
- '?actor=' in self.path:
- if self._editEvent(callingDomain, self.path,
- self.server.httpPrefix,
- self.server.domain,
- self.server.domainFull,
- self.server.baseDir,
- self.server.translate,
- self.server.mediaInstance,
- cookie):
- return
-
# edit profile in web interface
if self._editProfile(callingDomain, self.path,
self.server.translate,
@@ -12931,29 +12744,6 @@ class PubServer(BaseHTTPRequestHandler):
'show shares 2 done',
'show bookmarks 2 done')
- # get the events for a given person
- if self.path.endswith('/tlevents') or \
- '/tlevents?page=' in self.path or \
- self.path.endswith('/events') or \
- '/events?page=' in self.path:
- if self._showEventsTimeline(authorized,
- callingDomain, self.path,
- self.server.baseDir,
- self.server.httpPrefix,
- self.server.domain,
- self.server.domainFull,
- self.server.port,
- self.server.onionDomain,
- self.server.i2pDomain,
- GETstartTime, GETtimings,
- self.server.proxyType,
- cookie, self.server.debug):
- return
-
- self._benchmarkGETtimings(GETstartTime, GETtimings,
- 'show bookmarks 2 done',
- 'show events done')
-
# outbox timeline
if self._showOutboxTimeline(authorized,
callingDomain, self.path,
@@ -13333,11 +13123,6 @@ class PubServer(BaseHTTPRequestHandler):
else:
commentsEnabled = True
- if not fields.get('privateEvent'):
- privateEvent = False
- else:
- privateEvent = True
-
if postType == 'newpost':
if not fields.get('pinToProfile'):
pinToProfile = False
@@ -13621,64 +13406,6 @@ class PubServer(BaseHTTPRequestHandler):
return 1
else:
return -1
- elif postType == 'newevent':
- # A Mobilizon-type event is posted
-
- # if there is no image dscription then make it the same
- # as the event title
- if not fields.get('imageDescription'):
- fields['imageDescription'] = fields['subject']
- # Events are public by default, with opt-in
- # followers only status
- if not fields.get('followersOnlyEvent'):
- fields['followersOnlyEvent'] = False
-
- if not fields.get('anonymousParticipationEnabled'):
- anonymousParticipationEnabled = False
- else:
- anonymousParticipationEnabled = True
- maximumAttendeeCapacity = 999999
- if fields.get('maximumAttendeeCapacity'):
- maximumAttendeeCapacity = \
- int(fields['maximumAttendeeCapacity'])
-
- city = getSpoofedCity(self.server.city,
- self.server.baseDir,
- nickname,
- self.server.domain)
- messageJson = \
- createEventPost(self.server.baseDir,
- nickname,
- self.server.domain,
- self.server.port,
- self.server.httpPrefix,
- mentionsStr + fields['message'],
- privateEvent,
- False, False, commentsEnabled,
- filename, attachmentMediaType,
- fields['imageDescription'],
- city,
- fields['subject'],
- fields['schedulePost'],
- fields['eventDate'],
- fields['eventTime'],
- fields['location'],
- fields['category'],
- fields['joinMode'],
- fields['endDate'],
- fields['endTime'],
- maximumAttendeeCapacity,
- fields['repliesModerationOption'],
- anonymousParticipationEnabled,
- fields['eventStatus'],
- fields['ticketUrl'])
- if messageJson:
- if fields['schedulePost']:
- return 1
- if self._postToOutbox(messageJson, __version__, nickname):
- return 1
- else:
- return -1
elif postType == 'newdm':
messageJson = None
print('A DM was posted')
@@ -14190,7 +13917,6 @@ class PubServer(BaseHTTPRequestHandler):
if not self.path.endswith('confirm'):
self.path = self.path.replace('/outbox/', '/outbox')
self.path = self.path.replace('/tlblogs/', '/tlblogs')
- self.path = self.path.replace('/tlevents/', '/tlevents')
self.path = self.path.replace('/inbox/', '/inbox')
self.path = self.path.replace('/shares/', '/shares')
self.path = self.path.replace('/sharedInbox/', '/sharedInbox')
@@ -14528,7 +14254,7 @@ class PubServer(BaseHTTPRequestHandler):
# receive different types of post created by htmlNewPost
postTypes = ("newpost", "newblog", "newunlisted", "newfollowers",
"newdm", "newreport", "newshare", "newquestion",
- "editblogpost", "newreminder", "newevent")
+ "editblogpost", "newreminder")
for currPostType in postTypes:
if not authorized:
if self.server.debug:
@@ -14538,8 +14264,6 @@ class PubServer(BaseHTTPRequestHandler):
postRedirect = self.server.defaultTimeline
if currPostType == 'newshare':
postRedirect = 'shares'
- elif currPostType == 'newevent':
- postRedirect = 'tlevents'
pageNumber = \
self._receiveNewPost(currPostType, self.path,
diff --git a/inbox.py b/inbox.py
index cbc5f2da6..d1f6d2450 100644
--- a/inbox.py
+++ b/inbox.py
@@ -168,7 +168,7 @@ def _inboxStorePostToHtmlCache(recentPostsCache: {}, maxRecentPosts: int,
"""
pageNumber = -999
avatarUrl = None
- if boxname != 'tlevents' and boxname != 'outbox':
+ if boxname != 'outbox':
boxname = 'inbox'
individualPostAsHtml(True, recentPostsCache, maxRecentPosts,
@@ -2504,9 +2504,6 @@ def _inboxAfterInitial(recentPostsCache: {}, maxRecentPosts: int,
if isBlogPost(postJsonObject):
# blogs index will be updated
updateIndexList.append('tlblogs')
- elif isEventPost(postJsonObject):
- # events index will be updated
- updateIndexList.append('tlevents')
# get the avatar for a reply/announce
_obtainAvatarForReplyPost(session, baseDir,
diff --git a/outbox.py b/outbox.py
index 9a23041b5..156de5ace 100644
--- a/outbox.py
+++ b/outbox.py
@@ -337,8 +337,6 @@ def postMessageToOutbox(session, translate: {},
if messageJson['object'].get('type'):
if messageJson['object']['type'] == 'Article':
outboxName = 'tlblogs'
- elif messageJson['object']['type'] == 'Event':
- outboxName = 'tlevents'
savedFilename = \
savePostToBox(baseDir,
diff --git a/person.py b/person.py
index 8fa100572..ce426680f 100644
--- a/person.py
+++ b/person.py
@@ -28,7 +28,6 @@ from posts import createNewsTimeline
from posts import createBlogsTimeline
from posts import createFeaturesTimeline
from posts import createBookmarksTimeline
-from posts import createEventsTimeline
from posts import createInbox
from posts import createOutbox
from posts import createModeration
@@ -746,8 +745,7 @@ def personBoxJson(recentPostsCache: {},
boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'tlfeatures' and \
boxname != 'outbox' and boxname != 'moderation' and \
- boxname != 'tlbookmarks' and boxname != 'bookmarks' and \
- boxname != 'tlevents':
+ boxname != 'tlbookmarks' and boxname != 'bookmarks':
return None
if not '/' + boxname in path:
@@ -796,12 +794,6 @@ def personBoxJson(recentPostsCache: {},
port, httpPrefix,
noOfItems, headerOnly,
pageNumber)
- elif boxname == 'tlevents':
- return createEventsTimeline(recentPostsCache,
- session, baseDir, nickname, domain,
- port, httpPrefix,
- noOfItems, headerOnly,
- pageNumber)
elif boxname == 'tlreplies':
return createRepliesTimeline(recentPostsCache,
session, baseDir, nickname, domain,
diff --git a/posts.py b/posts.py
index aa9f26216..0751b9048 100644
--- a/posts.py
+++ b/posts.py
@@ -14,7 +14,6 @@ import os
import shutil
import sys
import time
-import uuid
import random
from socket import error as SocketError
from time import gmtime, strftime
@@ -657,8 +656,7 @@ def deleteAllPosts(baseDir: str,
"""Deletes all posts for a person from inbox or outbox
"""
if boxname != 'inbox' and boxname != 'outbox' and \
- boxname != 'tlblogs' and boxname != 'tlnews' and \
- boxname != 'tlevents':
+ boxname != 'tlblogs' and boxname != 'tlnews':
return
boxDir = createPersonDir(nickname, domain, baseDir, boxname)
for deleteFilename in os.scandir(boxDir):
@@ -681,7 +679,6 @@ def savePostToBox(baseDir: str, httpPrefix: str, postId: str,
"""
if boxname != 'inbox' and boxname != 'outbox' and \
boxname != 'tlblogs' and boxname != 'tlnews' and \
- boxname != 'tlevents' and \
boxname != 'scheduled':
return None
originalDomain = domain
@@ -1244,9 +1241,6 @@ def _createPostBase(baseDir: str, nickname: str, domain: str, port: int,
if isArticle:
savePostToBox(baseDir, httpPrefix, newPostId,
nickname, domain, newPost, 'tlblogs')
- elif eventUUID:
- savePostToBox(baseDir, httpPrefix, newPostId,
- nickname, domain, newPost, 'tlevents')
else:
savePostToBox(baseDir, httpPrefix, newPostId,
nickname, domain, newPost, 'outbox')
@@ -1653,57 +1647,6 @@ def createFollowersOnlyPost(baseDir: str,
None, None, None, None, None)
-def createEventPost(baseDir: str,
- nickname: str, domain: str, port: int,
- httpPrefix: str,
- content: str, followersOnly: bool,
- saveToFile: bool,
- clientToServer: bool, commentsEnabled: bool,
- attachImageFilename: str, mediaType: str,
- imageDescription: str, city: str,
- subject: str = None, schedulePost: str = False,
- eventDate: str = None, eventTime: str = None,
- location: str = None, category: str = None,
- joinMode: str = None,
- endDate: str = None, endTime: str = None,
- maximumAttendeeCapacity: int = None,
- repliesModerationOption: str = None,
- anonymousParticipationEnabled: bool = None,
- eventStatus: str = None, ticketUrl: str = None) -> {}:
- """Mobilizon-type Event post
- """
- if not attachImageFilename:
- print('Event has no attached image')
- return None
- if not category:
- print('Event has no category')
- return None
- domainFull = getFullDomain(domain, port)
-
- # create event uuid
- eventUUID = str(uuid.uuid1())
-
- toStr1 = 'https://www.w3.org/ns/activitystreams#Public'
- toStr2 = httpPrefix + '://' + domainFull + '/users/' + \
- nickname + '/followers',
- if followersOnly:
- toStr1 = toStr2
- toStr2 = None
- return _createPostBase(baseDir, nickname, domain, port,
- toStr1, toStr2,
- httpPrefix, content, followersOnly, saveToFile,
- clientToServer, commentsEnabled,
- attachImageFilename, mediaType,
- imageDescription, city,
- False, False, None, None, subject,
- schedulePost, eventDate, eventTime, location,
- eventUUID, category, joinMode,
- endDate, endTime, maximumAttendeeCapacity,
- repliesModerationOption,
- anonymousParticipationEnabled,
- eventStatus, ticketUrl)
-
-
def getMentionedPeople(baseDir: str, httpPrefix: str,
content: str, domain: str, debug: bool) -> []:
"""Extracts a list of mentioned actors from the given message content
@@ -2835,16 +2778,6 @@ def createBookmarksTimeline(session, baseDir: str, nickname: str, domain: str,
True, 0, False, 0, pageNumber)
-def createEventsTimeline(recentPostsCache: {},
- session, baseDir: str, nickname: str, domain: str,
- port: int, httpPrefix: str, itemsPerPage: int,
- headerOnly: bool, pageNumber: int = None) -> {}:
- return _createBoxIndexed(recentPostsCache, session, baseDir, 'tlevents',
- nickname, domain,
- port, httpPrefix, itemsPerPage, headerOnly,
- True, 0, False, 0, pageNumber)
-
-
def createDMTimeline(recentPostsCache: {},
session, baseDir: str, nickname: str, domain: str,
port: int, httpPrefix: str, itemsPerPage: int,
@@ -3179,8 +3112,7 @@ def _createBoxIndexed(recentPostsCache: {},
boxname != 'tlblogs' and boxname != 'tlnews' and \
boxname != 'tlfeatures' and \
boxname != 'outbox' and boxname != 'tlbookmarks' and \
- boxname != 'bookmarks' and \
- boxname != 'tlevents':
+ boxname != 'bookmarks':
return None
# bookmarks and events timelines are like the inbox
diff --git a/utils.py b/utils.py
index 0ac6b14d0..70b036cac 100644
--- a/utils.py
+++ b/utils.py
@@ -1139,7 +1139,7 @@ def locatePost(baseDir: str, nickname: str, domain: str,
postUrl = postUrl + '.' + extension
# search boxes
- boxes = ('inbox', 'outbox', 'tlblogs', 'tlevents')
+ boxes = ('inbox', 'outbox', 'tlblogs')
accountDir = baseDir + '/accounts/' + nickname + '@' + domain + '/'
for boxName in boxes:
postFilename = accountDir + boxName + '/' + postUrl
@@ -1401,7 +1401,7 @@ def _isReservedName(nickname: str) -> bool:
'public', 'followers', 'category',
'channel', 'calendar',
'tlreplies', 'tlmedia', 'tlblogs',
- 'tlevents', 'tlblogs', 'tlfeatures',
+ 'tlblogs', 'tlfeatures',
'moderation', 'moderationaction',
'activity', 'undo', 'pinned',
'reply', 'replies', 'question', 'like',
diff --git a/webapp_timeline.py b/webapp_timeline.py
index b7cda0e3d..2ba8e6881 100644
--- a/webapp_timeline.py
+++ b/webapp_timeline.py
@@ -129,20 +129,6 @@ def _htmlTimelineNewPost(manuallyApproveFollowers: bool,
'' + \
''
- elif boxName == 'tlevents':
- if not iconsAsButtons:
- newPostButtonStr += \
- '\n'
- else:
- newPostButtonStr += \
- '' + \
- ''
elif boxName == 'tlshares':
if not iconsAsButtons:
newPostButtonStr += \
@@ -500,8 +486,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
sharesButton = 'buttonselectedhighlighted'
elif boxName == 'tlbookmarks' or boxName == 'bookmarks':
bookmarksButton = 'buttonselected'
-# elif boxName == 'tlevents':
-# eventsButton = 'buttonselected'
# get the full domain, including any port number
fullDomain = getFullDomain(domain, port)
@@ -559,11 +543,6 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
''
-#
-# eventsButtonStr = \
-# ''
instanceTitle = \
getConfigParam(baseDir, 'instanceTitle')
@@ -1054,51 +1033,6 @@ def htmlBookmarks(cssCache: {}, defaultTimeline: str,
accessKeys)
-def htmlEvents(cssCache: {}, defaultTimeline: str,
- recentPostsCache: {}, maxRecentPosts: int,
- translate: {}, pageNumber: int, itemsPerPage: int,
- session, baseDir: str,
- cachedWebfingers: {}, personCache: {},
- nickname: str, domain: str, port: int, bookmarksJson: {},
- allowDeletion: bool,
- httpPrefix: str, projectVersion: str,
- minimal: bool, YTReplacementDomain: str,
- showPublishedDateOnly: bool,
- newswire: {}, positiveVoting: bool,
- showPublishAsIcon: bool,
- fullWidthTimelineButtonHeader: bool,
- iconsAsButtons: bool,
- rssIconAtTop: bool,
- publishButtonAtTop: bool,
- authorized: bool, theme: str,
- peertubeInstances: [],
- allowLocalNetworkAccess: bool,
- textModeBanner: str,
- accessKeys: {}) -> str:
- """Show the events as html
- """
- manuallyApproveFollowers = \
- followerApprovalActive(baseDir, nickname, domain)
-
- return htmlTimeline(cssCache, defaultTimeline,
- recentPostsCache, maxRecentPosts,
- translate, pageNumber,
- itemsPerPage, session, baseDir,
- cachedWebfingers, personCache,
- nickname, domain, port, bookmarksJson,
- 'tlevents', allowDeletion,
- httpPrefix, projectVersion, manuallyApproveFollowers,
- minimal, YTReplacementDomain,
- showPublishedDateOnly,
- newswire, False, False,
- positiveVoting, showPublishAsIcon,
- fullWidthTimelineButtonHeader,
- iconsAsButtons, rssIconAtTop, publishButtonAtTop,
- authorized, None, theme, peertubeInstances,
- allowLocalNetworkAccess, textModeBanner,
- accessKeys)
-
-
def htmlInboxDMs(cssCache: {}, defaultTimeline: str,
recentPostsCache: {}, maxRecentPosts: int,
translate: {}, pageNumber: int, itemsPerPage: int,