V0.6 #852

Merged
Atheros1 merged 399 commits from v0.6 into master 2016-05-03 01:58:38 +02:00
Showing only changes of commit 9d2e114712 - Show all commits

View File

@ -7,13 +7,20 @@ import inspect
from helper_sql import * from helper_sql import *
from addresses import decodeAddress from addresses import decodeAddress
from pyelliptic.openssl import OpenSSL from pyelliptic.openssl import OpenSSL
from utils import str_broadcast_subscribers
import time import time
def accountClass(address): def accountClass(address):
if not shared.config.has_section(address): if not shared.config.has_section(address):
subscription = SubscriptionAccount(address) if address == str_broadcast_subscribers:
if subscription.type != 'subscription': subscription = BroadcastAccount(address)
return None if subscription.type != 'broadcast':
return None
else:
subscription = SubscriptionAccount(address)
if subscription.type != 'subscription':
return None
return subscription
try: try:
gateway = shared.config.get(address, "gateway") gateway = shared.config.get(address, "gateway")
for name, cls in inspect.getmembers(sys.modules[__name__], inspect.isclass): for name, cls in inspect.getmembers(sys.modules[__name__], inspect.isclass):
@ -36,9 +43,11 @@ class BMAccount(object):
self.type = "chan" self.type = "chan"
elif shared.safeConfigGetBoolean(self.address, 'mailinglist'): elif shared.safeConfigGetBoolean(self.address, 'mailinglist'):
self.type = "mailinglist" self.type = "mailinglist"
elif self.address == str_broadcast_subscribers:
self.type = 'broadcast'
else: else:
queryreturn = sqlQuery( queryreturn = sqlQuery(
'''select label from subscriptions where address=?''', address) '''select label from subscriptions where address=?''', self.address)
if queryreturn: if queryreturn:
self.type = 'subscription' self.type = 'subscription'
@ -74,6 +83,10 @@ class SubscriptionAccount(BMAccount):
pass pass
class BroadcastAccount(BMAccount):
pass
class GatewayAccount(BMAccount): class GatewayAccount(BMAccount):
gatewayName = None gatewayName = None
def __init__(self, address): def __init__(self, address):