正在显示
1 个修改的文件
包含
3 行增加
和
2 行删除
| @@ -157,7 +157,7 @@ class RequestSource(): | @@ -157,7 +157,7 @@ class RequestSource(): | ||
| 157 | def get(cls, channel): | 157 | def get(cls, channel): |
| 158 | if isinstance(channel, str): | 158 | if isinstance(channel, str): |
| 159 | channel = int(channel) | 159 | channel = int(channel) |
| 160 | - return cls.const.get(channel, 'people_you_may_know') | 160 | + return cls.const.get(channel, channel) |
| 161 | 161 | ||
| 162 | 162 | ||
| 163 | class FacebookClient(Client): | 163 | class FacebookClient(Client): |
| @@ -229,6 +229,7 @@ class FacebookClient(Client): | @@ -229,6 +229,7 @@ class FacebookClient(Client): | ||
| 229 | 229 | ||
| 230 | def addFriend(self, fbid, channel=1): | 230 | def addFriend(self, fbid, channel=1): |
| 231 | how_found = RequestSource.get(channel) | 231 | how_found = RequestSource.get(channel) |
| 232 | + | ||
| 232 | data = { | 233 | data = { |
| 233 | "to_friend": fbid, | 234 | "to_friend": fbid, |
| 234 | "action": "add_friend", | 235 | "action": "add_friend", |
| @@ -238,7 +239,7 @@ class FacebookClient(Client): | @@ -238,7 +239,7 @@ class FacebookClient(Client): | ||
| 238 | if how_found == 'profile_friends': | 239 | if how_found == 'profile_friends': |
| 239 | data['ref_param'] = 'friends_tab' | 240 | data['ref_param'] = 'friends_tab' |
| 240 | 241 | ||
| 241 | - if channel == 2: | 242 | + if how_found == 'profile_button': |
| 242 | res = self._payload_post("/ajax/add_friend/action.php", data) | 243 | res = self._payload_post("/ajax/add_friend/action.php", data) |
| 243 | else: | 244 | else: |
| 244 | res = self._payload_post("/ajax/add_friend/action?" + self._to_url_params(data), {}) | 245 | res = self._payload_post("/ajax/add_friend/action?" + self._to_url_params(data), {}) |
-
请 注册 或 登录 后发表评论