Skip to content

Commit

Permalink
Push for testing new protocol, minus channel-search, missing-channel
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink committed Jul 2, 2016
1 parent a2a7b5a commit 295a4dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions Tribler/community/allchannel/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs):

# TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments
self.compatibility = AllChannelCompatibility(self)
self.compatibility_mode = True
self.compatibility_mode = False

self._blocklist = {}
self._recentlyRequested = []
Expand Down Expand Up @@ -315,7 +315,9 @@ def create_channelsearch(self, keywords):
query = " ".join(keywords)

# TODO REMOVE BACKWARD COMPATIBILITY: Delete if statement and positive case
if self.compatibility_mode:
# TODO DEBUG: Allow for remote channelsearches using old protocol
# if self.compatibility_mode:
if True:
meta = self.get_meta_message(u"channelsearch")
message = meta.impl(authentication=(self._my_member,),
distribution=(self.global_time,),
Expand Down
3 changes: 2 additions & 1 deletion Tribler/community/allchannel/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def on_votecast(self, messages):
self.parent.on_votecast(message, self._reconstruct_votecast(message))

def undo_votecast(self, descriptors, redo=False):
for message in messages:
for _, _, packet in descriptors:
message = packet.load_message()
self.parent.undo_votecast(message, self._reconstruct_votecast(message), redo)

2 changes: 1 addition & 1 deletion Tribler/community/bartercast4/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, dispersy, master, my_member):

# TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments
self.compatibility = Bartercast4Compatibility(self)
self.compatibility_mode = True
self.compatibility_mode = False

# add task for persisting bartercast statistics every BARTERCAST_PERSIST_INTERVAL seconds
self._logger.debug("bartercast persist task started")
Expand Down
6 changes: 4 additions & 2 deletions Tribler/community/channel/community.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, *args, **kwargs):

# TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments
self.compatibility = ChannelCompatibility(self)
self.compatibility_mode = True
self.compatibility_mode = False

self._channel_id = None
self._channel_name = None
Expand Down Expand Up @@ -1185,7 +1185,9 @@ def undo_mark_torrent(self, header, message, redo=False):
def disp_create_missing_channel(self, candidate, includeSnapshot):
logger.debug("%s sending missing-channel %s %s", candidate, self._cid.encode("HEX"), includeSnapshot)
# TODO REMOVE BACKWARD COMPATIBILITY: Delete if statement and positive case
if self.compatibility_mode:
# TODO DEBUG: Allow for remote missing channels using old protocol
# if self.compatibility_mode:
if True:
meta = self._meta_messages[u"missing-channel"]
request = meta.impl(distribution=(self.global_time,), destination=(candidate,), payload=(includeSnapshot,))
self._dispersy._forward([request])
Expand Down

0 comments on commit 295a4dc

Please sign in to comment.