@@ -126,23 +126,33 @@ def _executePaid(self, user):
126
126
user. The command behaves the same whatever the target (for now)."""
127
127
reply = ''
128
128
for payment in user .pastPayments ():
129
- if payment .category in [CATEGORY_SEND , CATEGORY_MOVE ]:
130
- reply += "\n BTC %s" % abs (payment .amount )
131
- if payment .otheraccount is not None :
132
- recipient = UserAccount (JID (payment .otheraccount ))
129
+ if payment .category not in [CATEGORY_SEND , CATEGORY_MOVE ]:
130
+ continue
131
+ if self .target is not None and (self .target .jid != payment .otheraccount ):
132
+ continue
133
+ reply += "\n BTC %s" % abs (payment .amount )
134
+ if payment .otheraccount is not None :
135
+ recipient = UserAccount (JID (payment .otheraccount ))
136
+ if recipient != self .target :
133
137
if user .isAdmin () or (0 != len (recipient .username )):
134
138
reply += " to %s" % recipient .getLabel ()
135
139
else :
136
140
reply += " to another user who became invisible since then"
137
- if payment .message is not None :
138
- reply += " (%s)" % payment .message
139
- confirmations = payment .confirmations
140
- if 0 <= confirmations :
141
- reply += " – %s confirmations" % payment .confirmations
141
+ if payment .message is not None :
142
+ reply += " (%s)" % payment .message
143
+ confirmations = payment .confirmations
144
+ if 0 <= confirmations :
145
+ reply += " – %s confirmations" % payment .confirmations
142
146
if 0 == len (reply ):
143
- reply = "You didn't send any coins"
147
+ if self .target is None :
148
+ reply = "You didn't send any coins"
149
+ else :
150
+ reply = "You didn't send me any coins"
144
151
else :
145
- reply = "You paid:%s" % reply
152
+ if self .target is None :
153
+ reply = "You paid:%s" % reply
154
+ else :
155
+ reply = "You paid me:%s" % reply
146
156
return reply
147
157
148
158
def _executeCancel (self , user , code = None ):
0 commit comments