Conversation
|
Thanks for submitting this @Mini-Geek. It's a lot of functionality that seems a little complicated to use directly so I'm not sure how to properly expose it, but it's great to have this functionality explored like this and I'll leave the PR open in case anyone else wants to contribute their opinions. |
|
Hey Thanks for that PR. What does |
|
When you do a search and click on a result to see the context, search_context.php is called. Also when you click to see more context above or below the found message, it calls search_context.php. |
bsansouci
left a comment
There was a problem hiding this comment.
Ah ok that makes sense. Could you document both functions? I left a bunch of comments too :)
After that we can merge!
Thanks
|
|
||
| module.exports = function(defaultFuncs, api, ctx) { | ||
| return function searchContext(messageID, threadID, isGroup, limit, direction, callback) { | ||
| if(!callback && utils.getType(threadID) === 'Function') { |
There was a problem hiding this comment.
Could you do utils.getType(threadID) !== "String" instead?
| limit: limit || 6, | ||
| direction: direction, | ||
| }; | ||
| if (isGroup) { |
There was a problem hiding this comment.
Could you remove isGroup and use the same trick we used in sendMessage
facebook-chat-api/src/sendMessage.js
Line 155 in 9da5303
We make a call to
getUserInfo and do Object.keys(res).length > 0, if it's true then it's a 1-1 thread, if it's false then it's a group thread.
So this is not very polished or documented, but it does work. This adds the message search feature requested in issue #287.