Skip to content

Commit

Permalink
Reinstated propagating UserResolveNotification for plugin system
Browse files Browse the repository at this point in the history
  • Loading branch information
Quinox committed Oct 31, 2010
1 parent 1b14bed commit 915f863
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pynicotine/pluginsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ def OutgoingBuddySearchEvent(self, text):
return self.TriggerEvent("OutgoingBuddySearchEvent", (text,))
def OutgoingUserSearchEvent(self, users):
return self.TriggerEvent("OutgoingUserSearchEvent", (users,))
def UserResolveNotification(self, user, ip, port, country):
def UserResolveNotification(self, user, ip, port, country=None):
"""Notification for user IP:Port resolving.
Note that country is only set when the user requested the resolving"""
start_new_thread(self.TriggerEvent, ("UserResolveNotification", (user, ip, port, country)))
def ServerConnectNotification(self):
start_new_thread(self.TriggerEvent, ("ServerConnectNotification", (),))
Expand Down
3 changes: 3 additions & 0 deletions pynicotine/pynicotine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,12 @@ def GetPeerAddress(self, msg):
self.frame.OnIgnoreUser(msg.user)
del self.ipignore_requested[msg.user]
return
# From this point on all paths should call
# self.frame.pluginhandler.UserResolveNotification precisely once
if msg.user in self.PrivateMessageQueue:
self.PrivateMessageQueueProcess(msg.user)
if msg.user not in self.ip_requested:
self.frame.pluginhandler.UserResolveNotification(msg.user, msg.ip, msg.port)
return
self.ip_requested.remove(msg.user)
import socket
Expand Down
2 changes: 1 addition & 1 deletion pynicotine/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def CleanPath(path, absolute=False):
for char in illegalpathchars:
path = path.replace(char, replacementchar)
path = ''.join([drive, path])
# Path can never end in a period on Windows machines
# Path can never end with a period on Windows machines
path = path.rstrip('.')
return path

Expand Down

0 comments on commit 915f863

Please sign in to comment.