fca-unofficial
Advanced tools
Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "fca-unofficial", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -175,3 +175,3 @@ "use strict"; | ||
function send(form, threadID, messageAndOTID, callback) { | ||
function send(form, threadID, messageAndOTID, callback, isGroup) { | ||
// We're doing a query to this to check if the given id is the id of | ||
@@ -183,14 +183,18 @@ // a user or of a group chat. The form will be different depending | ||
} else { | ||
api.getUserInfo(threadID, function(err, res) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
sendContent( | ||
form, | ||
threadID, | ||
Object.keys(res).length > 0, | ||
messageAndOTID, | ||
callback | ||
); | ||
}); | ||
if (isGroup == null || utils.getType(isGroup) != "Boolean") { | ||
api.getUserInfo(threadID, function(err, res) { | ||
if (err) { | ||
return callback(err); | ||
} | ||
sendContent( | ||
form, | ||
threadID, | ||
Object.keys(res).length > 0, | ||
messageAndOTID, | ||
callback | ||
); | ||
}); | ||
} else { | ||
sendContent(form, threadID, isGroup, messageAndOTID, callback); | ||
} | ||
} | ||
@@ -308,3 +312,4 @@ } | ||
return function sendMessage(msg, threadID, callback, replyToMessage) { | ||
return function sendMessage(msg, threadID, callback, replyToMessage, isGroup) { | ||
typeof isGroup == "undefined" ? isGroup = null : ""; | ||
if ( | ||
@@ -416,3 +421,3 @@ !callback && | ||
handleMention(msg, form, callback, () => | ||
send(form, threadID, messageAndOTID, callback) | ||
send(form, threadID, messageAndOTID, callback, isGroup) | ||
) | ||
@@ -419,0 +424,0 @@ ) |
536318
6659