Filter out owner presence/messages
This commit is contained in:
parent
6a45bea079
commit
878714a627
@ -31,8 +31,7 @@ class Owner(Buddy):
|
|||||||
if not nick or not len(nick):
|
if not nick or not len(nick):
|
||||||
nick = "n00b"
|
nick = "n00b"
|
||||||
|
|
||||||
service_name = nick + '.' + GROUP_SERVICE_TYPE
|
service = Service(nick, '', '', GROUP_SERVICE_PORT)
|
||||||
service = Service(service_name, '', '', GROUP_SERVICE_PORT)
|
|
||||||
|
|
||||||
Buddy.__init__(self, service, nick)
|
Buddy.__init__(self, service, nick)
|
||||||
|
|
||||||
|
12
p2p/Group.py
12
p2p/Group.py
@ -67,11 +67,13 @@ class LocalGroup(Group):
|
|||||||
|
|
||||||
def _on_service_resolved(self, interface, protocol, name, stype, domain,
|
def _on_service_resolved(self, interface, protocol, name, stype, domain,
|
||||||
host, aprotocol, address, port, txt, flags):
|
host, aprotocol, address, port, txt, flags):
|
||||||
service = Service(name, host, address, port)
|
print name
|
||||||
self._services[name] = service
|
if name != self._owner.get_service().get_name():
|
||||||
if stype == BUDDY_SERVICE_TYPE:
|
service = Service(name, host, address, port)
|
||||||
data = self._pair_to_dict(avahi.txt_array_to_string_array(txt))
|
self._services[name] = service
|
||||||
self._add_buddy(service, data)
|
if stype == BUDDY_SERVICE_TYPE:
|
||||||
|
data = self._pair_to_dict(avahi.txt_array_to_string_array(txt))
|
||||||
|
self._add_buddy(service, data)
|
||||||
|
|
||||||
def _add_buddy(self, service, data):
|
def _add_buddy(self, service, data):
|
||||||
name = service.get_name()
|
name = service.get_name()
|
||||||
|
@ -37,5 +37,7 @@ class StreamReader:
|
|||||||
self._recv(msg['addr'], msg['data'])
|
self._recv(msg['addr'], msg['data'])
|
||||||
|
|
||||||
def _recv(self, address, data):
|
def _recv(self, address, data):
|
||||||
buddy = self._group.get_buddy_from_address(address)
|
owner = self._group.get_owner()
|
||||||
self._callback(buddy, data)
|
if address != owner.get_service().get_address():
|
||||||
|
buddy = self._group.get_buddy_from_address(address)
|
||||||
|
self._callback(buddy, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user