Skip to content

Commit

Permalink
Facebook support removed, adhering to recent news regarding their
Browse files Browse the repository at this point in the history
future plans on keeping XMPP support.

Older releases would work till April 10, 2015 - but removing it
nevertheless with a new release and break this compatibility

                 Releasing 4.1
  • Loading branch information
Harshavardhana committed Dec 20, 2014
1 parent 8f2825f commit 6ce50aa
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 265 deletions.
6 changes: 6 additions & 0 deletions FACEBOOK.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Facebook support was removed as of 4.1 release - in accordance with their
recent update about future of XMPP support, older releases will still work
until Facebook ceases support from April 10, 2015

- https://developers.facebook.com/docs/apps/changelog
- https://developers.facebook.com/docs/chat/
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------
Dec 19, 2014
* GNU Freetalk 4.1 released.
------------

------------
Dec 12, 2014
* GNU Freetalk 4.0.1 released.
Expand Down
26 changes: 1 addition & 25 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dnl GNU General Public license v3 or later

dnl Process this file with autoconf to produce a configure script

AC_INIT([freetalk], [4.0.1], [https://github.com/GNUFreetalk/freetalk/issues])
AC_INIT([freetalk], [4.1], [https://github.com/GNUFreetalk/freetalk/issues])
AM_INIT_AUTOMAKE

AC_PREREQ([2.57])
Expand Down Expand Up @@ -84,30 +84,6 @@ if test "x$HAVE_LOUDMOUTH" == "xno"; then
AC_MSG_ERROR([ERROR! loudmouth-1.0 not found...])
fi

AC_ARG_ENABLE([facebook],
[AS_HELP_STRING([--disable-facebook], [disable facebook support])],
[],
[enable_facebook=yes])

AS_IF([test "x$enable_facebook" = "xyes"], [
PKG_CHECK_MODULES([CURL], [libcurl], [HAVE_CURL="yes"], [HAVE_CURL="no"])
if test "x$HAVE_CURL" == "xno"; then
AC_MSG_ERROR([ERROR! libcurl not found...])
fi
PKG_CHECK_MODULES([JANSSON], [jansson], [HAVE_JANSSON="yes"], [HAVE_JANSSON="no"])
if test "x$HAVE_JANSSON" == "xno"; then
AC_MSG_ERROR([ERROR! jansson not found...])
fi
if test "x$HAVE_CURL" == "xyes" -a "x$HAVE_JANSSON" == "xyes"; then
AC_DEFINE(FACEBOOK, 1, [enable facebook jid translation support])
FACEBOOK_LIBS="${CURL_LIBS} ${JANSSON_LIBS}"
AC_SUBST(FACEBOOK_LIBS)
fi
])

AC_CHECK_HEADERS([libintl.h])

AC_OUTPUT
1 change: 1 addition & 0 deletions doc/authors.texi
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@item 1. @tab Anand Babu @tab @email{aperiasamy@@gmail.com}
@item 2. @tab Harshavardhana @tab @email{harsha@@harshavardhana.net}
@item 3. @tab Anis Elleuch @tab @email{vadmeste@@gmail.com}
@item 4. @tab Nikola Beneš @tab @email{nikola.benes@@gmail.com}
@end multitable

@subsection InActive
Expand Down
4 changes: 2 additions & 2 deletions examples/freetalk.scm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

;; Example proxy configuration
; (and (string=? (ft-get-jid) "")
; (ft-set-jid! "yourid@chat.facebook.com")
; (ft-set-jid! "yourid@gmail.com")
; (ft-set-password! "p4ssw0rd")
; (ft-set-tlsconn! #t)
; (ft-set-prompt! "freetalk: ")
; (ft-set-server! "chat.facebook.com")
; (ft-set-server! "talk.google.com")
; (ft-set-proxyserver! "your.proxyserver.net")
; (ft-set-proxyport! "8080"))

Expand Down
8 changes: 4 additions & 4 deletions examples/hello-world.ft
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
; chmod +x hello-world.ft
; ./hello-world.ft

(ft-set-jid! "YOUR-NAME@chat.facebook.com")
(ft-set-server! "chat.facebook.com")
(ft-set-jid! "YOUR-NAME@gmail.com")
(ft-set-server! "talk.google.com")
(ft-set-password! "YOUR-PASSWORD")
(ft-set-sslconn! #t)

(if (ft-login-blocking)
(begin
(ft-send-message "YOUR-FRIEND@chat.facebook.com" "Hi")
(ft-send-message "YOUR-FRIEND@chat.facebook.com" "Are you there?")
(ft-send-message "YOUR-FRIEND@gmail.com" "Hi")
(ft-send-message "YOUR-FRIEND@gmail.com" "Are you there?")
(ft-disconnect))
(display "Could not connect\n"))
2 changes: 0 additions & 2 deletions extensions/connection.scm
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@

(define (domain->server domain)
(cond ((string=? domain "jabber.org") "jabber.org")
((string=? domain "facebook.com") "chat.facebook.com")
((string=? domain "chat.facebook.com") "chat.facebook.com")
((string=? domain "gmail.com") "talk.google.com")
(else domain)))

Expand Down
14 changes: 3 additions & 11 deletions extensions/login.scm
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,16 @@
(exit 1)))

(define (domain->server domain)
(cond ((string=? domain "facebook.com") "chat.facebook.com")
((string=? domain "chat.facebook.com") "chat.facebook.com")
((string=? domain "gmail.com") "talk.google.com")
(cond ((string=? domain "gmail.com") "talk.google.com")
(else domain)))

(define (domain->port domain)
(cond ((string=? domain "facebook.com") 5222)
((string=? domain "chat.facebook.com") 5222)
((string=? domain "gmail.com") 5223)
(cond ((string=? domain "gmail.com") 5223)
((string=? domain "jabber.org") 5222)
(else 5222)))

(define (domain->ssl domain)
(cond ((string=? domain "facebook.com")
(ft-set-tlsconn! #t))
((string=? domain "chat.facebook.com")
(ft-set-tlsconn! #t))
((string=? domain "gmail.com")
(cond ((string=? domain "gmail.com")
(ft-set-sslconn! #t))
(else "")))

Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ noinst_HEADERS = freetalk.h util.h commands.h callbacks.h \

freetalk_LDADD = $(ARGP_STANDALONE_LDADD)

LIBS = $(LOUDMOUTH_LIBS) $(GLIB_LIBS) $(GUILE_LIBS) $(RLLIBS) $(FACEBOOK_LIBS)
LIBS = $(LOUDMOUTH_LIBS) $(GLIB_LIBS) $(GUILE_LIBS) $(RLLIBS) # $(FACEBOOK_LIBS)

AM_CFLAGS = -Wall -g $(GUILE_CFLAGS) $(GLIB_CFLAGS) $(LOUDMOUTH_CFLAGS) \
$(ARGP_STANDALONE_CFLAGS)
Expand Down
10 changes: 2 additions & 8 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ ft_msg_msg_handler (LmMessageHandler *handler, LmConnection *conn,
LmMessageNode *root, *body, *x;
const char *from, *msg_str, *type;
char *ts = NULL;
int64_t id = 0;
char *new_from = NULL;

root = lm_message_get_node (msg);
Expand Down Expand Up @@ -162,16 +161,11 @@ ft_msg_msg_handler (LmMessageHandler *handler, LmConnection *conn,
set_hook_return (0);
{
FtRosterItem *item = NULL;
char *nickname;

if (is_facebook ())
get_username_id_from_jid (from, &new_from, &id);
else
new_from = g_strdup (from);

new_from = g_strdup (from);
item = ft_roster_lookup (new_from);

char *nickname;

if (!item)
nickname = NULL;
else
Expand Down
15 changes: 1 addition & 14 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,27 +346,14 @@ do_send_message_no_hook (char *jid, char *msg_str)
{
LmMessage *msg;
state.last = time(NULL);
/* For facebook username->id translation */
char jid_buf[256] = {0,};
char *real_jid = NULL;

if (!jid || !msg_str)
return -2;

if (do_get_conn_status () != FT_AUTH)
return -1;

if (is_facebook ()) {
snprintf (jid_buf, sizeof(jid_buf),
"%"PRId64"@chat.facebook.com",
-(state.current_buddy->id));
real_jid = g_strdup (jid_buf);
if (!real_jid)
return -2;
msg = lm_message_new (real_jid, LM_MESSAGE_TYPE_MESSAGE);
} else {
msg = lm_message_new (jid, LM_MESSAGE_TYPE_MESSAGE);
}
msg = lm_message_new (jid, LM_MESSAGE_TYPE_MESSAGE);

lm_message_node_set_attribute (msg->node, "type", "chat");
lm_message_node_add_child (msg->node, "body", msg_str);
Expand Down
8 changes: 0 additions & 8 deletions src/presence.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,12 @@ presence_availability_rcvd (const char *from, LmMessage *msg)
{
FtRosterItem *newi;
FtRosterItem *old;
char *username = NULL;
int64_t id = 0;

if (!from || !msg)
return;

newi = roster_item_extract (msg);

if (is_facebook ()) {
get_username_id_from_jid (newi->jid, &username, &id);
newi->jid = username;
newi->id = id;
}

scm_run_hook (ex_presence_receive_hook,
roster_item_to_list (newi));

Expand Down
Loading

0 comments on commit 6ce50aa

Please sign in to comment.