diff --git a/content.py b/content.py
index 2e66ef4d2..e823bfc1b 100644
--- a/content.py
+++ b/content.py
@@ -66,6 +66,7 @@ def addWebLinks(content: str) -> str:
for w in words:
if w.startswith('https://') or \
w.startswith('http://') or \
+ w.startswith('i2p://') or \
w.startswith('dat://'):
if w.endswith('.') or w.endswith(';'):
w=w[:-1]
@@ -74,9 +75,11 @@ def addWebLinks(content: str) -> str:
markup+='https://'
elif w.startswith('http://'):
markup+='http://'
+ elif w.startswith('i2p://'):
+ markup+='i2p://'
elif w.startswith('dat://'):
markup+='dat://'
- linkText=w.replace('https://','').replace('http://','').replace('dat://','')
+ linkText=w.replace('https://','').replace('http://','').replace('dat://','').replace('i2p://','')
# prevent links from becoming too long
if len(linkText)>maxLinkLength:
markup+=''+linkText[:maxLinkLength]+''
@@ -276,6 +279,8 @@ def removeLongWords(content: str,maxWordLength: int,longWordsList: []) -> str:
continue
elif 'http:' in wordStr:
continue
+ elif 'i2p:' in wordStr:
+ continue
elif 'dat:' in wordStr:
continue
if '<' in wordStr:
@@ -396,6 +401,7 @@ def getMentionsFromHtml(htmlText: str,matchStr=" (str,int):
"""
port=None
if '/profile/' in actor:
- domain = actor.split('/profile/')[0].replace('https://','').replace('http://','').replace('dat://','')
+ domain = actor.split('/profile/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
else:
if '/channel/' in actor:
- domain = actor.split('/channel/')[0].replace('https://','').replace('http://','').replace('dat://','')
+ domain = actor.split('/channel/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
else:
if '/users/' not in actor:
- domain = actor.replace('https://','').replace('http://','').replace('dat://','')
+ domain = actor.replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
if '/' in actor:
domain=domain.split('/')[0]
else:
- domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('dat://','')
+ domain = actor.split('/users/')[0].replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','')
if ':' in domain:
port=int(domain.split(':')[1])
domain=domain.split(':')[0]
diff --git a/webfinger.py b/webfinger.py
index a3fe33108..84930e3bc 100644
--- a/webfinger.py
+++ b/webfinger.py
@@ -24,11 +24,11 @@ def parseHandle(handle: str) -> (str,str):
return None, None
if '/@' in handle:
domain, nickname = \
- handle.replace('https://','').replace('http://','').replace('dat://','').split('/@')
+ handle.replace('https://','').replace('http://','').replace('dat://','').replace('i2p://','').split('/@')
else:
if '/users/' in handle:
domain, nickname = \
- handle.replace('https://','').replace('http://','').replace('dat://','').split('/users/')
+ handle.replace('https://','').replace('http://','').replace('i2p://','').replace('dat://','').split('/users/')
else:
if '@' in handle:
nickname, domain = handle.split('@')
diff --git a/webinterface.py b/webinterface.py
index a8230a5f2..a6f83c8e6 100644
--- a/webinterface.py
+++ b/webinterface.py
@@ -1819,7 +1819,7 @@ def addEmbeddedAudio(translate: {},content: str) -> str:
if not w.endswith(extension):
continue
- if not (w.startswith('http') or w.startswith('dat:') or '/' in w):
+ if not (w.startswith('http') or w.startswith('dat:') or w.startswith('i2p:') or '/' in w):
continue
url=w
content+='