mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Snake case
							parent
							
								
									2b90a745b6
								
							
						
					
					
						commit
						4cdad10897
					
				| 
						 | 
					@ -23,7 +23,7 @@ from utils import save_json
 | 
				
			||||||
from utils import undoAnnounceCollectionEntry
 | 
					from utils import undoAnnounceCollectionEntry
 | 
				
			||||||
from utils import updateAnnounceCollection
 | 
					from utils import updateAnnounceCollection
 | 
				
			||||||
from utils import local_actor_url
 | 
					from utils import local_actor_url
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from utils import has_actor
 | 
					from utils import has_actor
 | 
				
			||||||
from utils import has_object_stringType
 | 
					from utils import has_object_stringType
 | 
				
			||||||
from posts import sendSignedJson
 | 
					from posts import sendSignedJson
 | 
				
			||||||
| 
						 | 
					@ -318,7 +318,7 @@ def sendUndoAnnounceViaServer(base_dir: str, session,
 | 
				
			||||||
    domain_full = get_full_domain(domain, port)
 | 
					    domain_full = get_full_domain(domain, port)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    actor = local_actor_url(http_prefix, nickname, domain_full)
 | 
					    actor = local_actor_url(http_prefix, nickname, domain_full)
 | 
				
			||||||
    handle = replaceUsersWithAt(actor)
 | 
					    handle = replace_users_with_at(actor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    statusNumber, published = getStatusNumber()
 | 
					    statusNumber, published = getStatusNumber()
 | 
				
			||||||
    unAnnounceJson = {
 | 
					    unAnnounceJson = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -249,7 +249,7 @@ from utils import has_actor
 | 
				
			||||||
from utils import setReplyIntervalHours
 | 
					from utils import setReplyIntervalHours
 | 
				
			||||||
from utils import canReplyTo
 | 
					from utils import canReplyTo
 | 
				
			||||||
from utils import isDM
 | 
					from utils import isDM
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from utils import local_actor_url
 | 
					from utils import local_actor_url
 | 
				
			||||||
from utils import isfloat
 | 
					from utils import isfloat
 | 
				
			||||||
from utils import validPassword
 | 
					from utils import validPassword
 | 
				
			||||||
| 
						 | 
					@ -13977,7 +13977,7 @@ class PubServer(BaseHTTPRequestHandler):
 | 
				
			||||||
                                            pinnedPostJson)
 | 
					                                            pinnedPostJson)
 | 
				
			||||||
                message_json['id'] = postId + '/activity'
 | 
					                message_json['id'] = postId + '/activity'
 | 
				
			||||||
                message_json['object']['id'] = postId
 | 
					                message_json['object']['id'] = postId
 | 
				
			||||||
                message_json['object']['url'] = replaceUsersWithAt(postId)
 | 
					                message_json['object']['url'] = replace_users_with_at(postId)
 | 
				
			||||||
                message_json['object']['atomUri'] = postId
 | 
					                message_json['object']['atomUri'] = postId
 | 
				
			||||||
            msg = json.dumps(message_json,
 | 
					            msg = json.dumps(message_json,
 | 
				
			||||||
                             ensure_ascii=False).encode('utf-8')
 | 
					                             ensure_ascii=False).encode('utf-8')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -40,7 +40,7 @@ from roles import getActorRolesList
 | 
				
			||||||
from media import processMetaData
 | 
					from media import processMetaData
 | 
				
			||||||
from utils import removeHtml
 | 
					from utils import removeHtml
 | 
				
			||||||
from utils import containsInvalidChars
 | 
					from utils import containsInvalidChars
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from utils import removeLineEndings
 | 
					from utils import removeLineEndings
 | 
				
			||||||
from utils import removeDomainPort
 | 
					from utils import removeDomainPort
 | 
				
			||||||
from utils import getStatusNumber
 | 
					from utils import getStatusNumber
 | 
				
			||||||
| 
						 | 
					@ -852,7 +852,7 @@ def personUpgradeActor(base_dir: str, personJson: {},
 | 
				
			||||||
        # update domain/@nickname in actors cache
 | 
					        # update domain/@nickname in actors cache
 | 
				
			||||||
        actorCacheFilename = \
 | 
					        actorCacheFilename = \
 | 
				
			||||||
            base_dir + '/accounts/cache/actors/' + \
 | 
					            base_dir + '/accounts/cache/actors/' + \
 | 
				
			||||||
            replaceUsersWithAt(personJson['id']).replace('/', '#') + \
 | 
					            replace_users_with_at(personJson['id']).replace('/', '#') + \
 | 
				
			||||||
            '.json'
 | 
					            '.json'
 | 
				
			||||||
        if os.path.isfile(actorCacheFilename):
 | 
					        if os.path.isfile(actorCacheFilename):
 | 
				
			||||||
            save_json(personJson, actorCacheFilename)
 | 
					            save_json(personJson, actorCacheFilename)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								pgp.py
								
								
								
								
							
							
						
						
									
										4
									
								
								pgp.py
								
								
								
								
							| 
						 | 
					@ -16,7 +16,7 @@ from utils import isPGPEncrypted
 | 
				
			||||||
from utils import get_full_domain
 | 
					from utils import get_full_domain
 | 
				
			||||||
from utils import getStatusNumber
 | 
					from utils import getStatusNumber
 | 
				
			||||||
from utils import local_actor_url
 | 
					from utils import local_actor_url
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from webfinger import webfingerHandle
 | 
					from webfinger import webfingerHandle
 | 
				
			||||||
from posts import getPersonBox
 | 
					from posts import getPersonBox
 | 
				
			||||||
from auth import createBasicAuthHeader
 | 
					from auth import createBasicAuthHeader
 | 
				
			||||||
| 
						 | 
					@ -501,7 +501,7 @@ def pgpPublicKeyUpload(base_dir: str, session,
 | 
				
			||||||
        print('Actor for ' + handle + ' obtained')
 | 
					        print('Actor for ' + handle + ' obtained')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    actor = local_actor_url(http_prefix, nickname, domain_full)
 | 
					    actor = local_actor_url(http_prefix, nickname, domain_full)
 | 
				
			||||||
    handle = replaceUsersWithAt(actor)
 | 
					    handle = replace_users_with_at(actor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # check that this looks like the correct actor
 | 
					    # check that this looks like the correct actor
 | 
				
			||||||
    if not actor_json.get('id'):
 | 
					    if not actor_json.get('id'):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										8
									
								
								posts.py
								
								
								
								
							
							
						
						
									
										8
									
								
								posts.py
								
								
								
								
							| 
						 | 
					@ -36,7 +36,7 @@ from utils import get_user_paths
 | 
				
			||||||
from utils import invalidCiphertext
 | 
					from utils import invalidCiphertext
 | 
				
			||||||
from utils import has_object_stringType
 | 
					from utils import has_object_stringType
 | 
				
			||||||
from utils import removeIdEnding
 | 
					from utils import removeIdEnding
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from utils import hasGroupType
 | 
					from utils import hasGroupType
 | 
				
			||||||
from utils import get_base_content_from_post
 | 
					from utils import get_base_content_from_post
 | 
				
			||||||
from utils import removeDomainPort
 | 
					from utils import removeDomainPort
 | 
				
			||||||
| 
						 | 
					@ -1694,7 +1694,7 @@ def getPinnedPostAsJson(base_dir: str, http_prefix: str,
 | 
				
			||||||
                'tag': [],
 | 
					                'tag': [],
 | 
				
			||||||
                'to': ['https://www.w3.org/ns/activitystreams#Public'],
 | 
					                'to': ['https://www.w3.org/ns/activitystreams#Public'],
 | 
				
			||||||
                'type': 'Note',
 | 
					                'type': 'Note',
 | 
				
			||||||
                'url': replaceUsersWithAt(actor) + '/pinned'
 | 
					                'url': replace_users_with_at(actor) + '/pinned'
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
    return pinnedPostJson
 | 
					    return pinnedPostJson
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4860,7 +4860,7 @@ def sendMuteViaServer(base_dir: str, session,
 | 
				
			||||||
    fromDomainFull = get_full_domain(fromDomain, fromPort)
 | 
					    fromDomainFull = get_full_domain(fromDomain, fromPort)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
 | 
					    actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
 | 
				
			||||||
    handle = replaceUsersWithAt(actor)
 | 
					    handle = replace_users_with_at(actor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    newMuteJson = {
 | 
					    newMuteJson = {
 | 
				
			||||||
        "@context": "https://www.w3.org/ns/activitystreams",
 | 
					        "@context": "https://www.w3.org/ns/activitystreams",
 | 
				
			||||||
| 
						 | 
					@ -4940,7 +4940,7 @@ def sendUndoMuteViaServer(base_dir: str, session,
 | 
				
			||||||
    fromDomainFull = get_full_domain(fromDomain, fromPort)
 | 
					    fromDomainFull = get_full_domain(fromDomain, fromPort)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
 | 
					    actor = local_actor_url(http_prefix, fromNickname, fromDomainFull)
 | 
				
			||||||
    handle = replaceUsersWithAt(actor)
 | 
					    handle = replace_users_with_at(actor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    undoMuteJson = {
 | 
					    undoMuteJson = {
 | 
				
			||||||
        "@context": "https://www.w3.org/ns/activitystreams",
 | 
					        "@context": "https://www.w3.org/ns/activitystreams",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								utils.py
								
								
								
								
							
							
						
						
									
										2
									
								
								utils.py
								
								
								
								
							| 
						 | 
					@ -3148,7 +3148,7 @@ def getSharesFilesList() -> []:
 | 
				
			||||||
    return ('shares', 'wanted')
 | 
					    return ('shares', 'wanted')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def replaceUsersWithAt(actor: str) -> str:
 | 
					def replace_users_with_at(actor: str) -> str:
 | 
				
			||||||
    """ https://domain/users/nick becomes https://domain/@nick
 | 
					    """ https://domain/users/nick becomes https://domain/@nick
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
    u_paths = get_user_paths()
 | 
					    u_paths = get_user_paths()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,7 @@ from utils import getAltPath
 | 
				
			||||||
from utils import removeDomainPort
 | 
					from utils import removeDomainPort
 | 
				
			||||||
from utils import acct_dir
 | 
					from utils import acct_dir
 | 
				
			||||||
from utils import local_actor_url
 | 
					from utils import local_actor_url
 | 
				
			||||||
from utils import replaceUsersWithAt
 | 
					from utils import replace_users_with_at
 | 
				
			||||||
from happening import getTodaysEvents
 | 
					from happening import getTodaysEvents
 | 
				
			||||||
from happening import getCalendarEvents
 | 
					from happening import getCalendarEvents
 | 
				
			||||||
from webapp_utils import setCustomBackground
 | 
					from webapp_utils import setCustomBackground
 | 
				
			||||||
| 
						 | 
					@ -175,7 +175,7 @@ def _htmlCalendarDay(person_cache: {}, cssCache: {}, translate: {},
 | 
				
			||||||
            if senderName and eventDescription:
 | 
					            if senderName and eventDescription:
 | 
				
			||||||
                # if the sender is also mentioned within the event
 | 
					                # if the sender is also mentioned within the event
 | 
				
			||||||
                # description then this is a reminder
 | 
					                # description then this is a reminder
 | 
				
			||||||
                senderActor2 = replaceUsersWithAt(senderActor)
 | 
					                senderActor2 = replace_users_with_at(senderActor)
 | 
				
			||||||
                if senderActor not in eventDescription and \
 | 
					                if senderActor not in eventDescription and \
 | 
				
			||||||
                   senderActor2 not in eventDescription:
 | 
					                   senderActor2 not in eventDescription:
 | 
				
			||||||
                    eventDescription = senderName + eventDescription
 | 
					                    eventDescription = senderName + eventDescription
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue