[1b221e0] | 1 | /***************************************************************************\ |
---|
| 2 | * * |
---|
| 3 | * BitlBee - An IRC to IM gateway * |
---|
| 4 | * Simple module to facilitate twitter functionality. * |
---|
| 5 | * * |
---|
| 6 | * Copyright 2009 Geert Mulders <g.c.w.m.mulders@gmail.com> * |
---|
| 7 | * * |
---|
| 8 | * This library is free software; you can redistribute it and/or * |
---|
| 9 | * modify it under the terms of the GNU Lesser General Public * |
---|
| 10 | * License as published by the Free Software Foundation, version * |
---|
| 11 | * 2.1. * |
---|
| 12 | * * |
---|
| 13 | * This library is distributed in the hope that it will be useful, * |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
---|
| 16 | * Lesser General Public License for more details. * |
---|
| 17 | * * |
---|
| 18 | * You should have received a copy of the GNU Lesser General Public License * |
---|
| 19 | * along with this library; if not, write to the Free Software Foundation, * |
---|
| 20 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * |
---|
| 21 | * * |
---|
| 22 | ****************************************************************************/ |
---|
| 23 | |
---|
| 24 | #include "nogaim.h" |
---|
| 25 | |
---|
| 26 | #ifndef _TWITTER_H |
---|
| 27 | #define _TWITTER_H |
---|
| 28 | |
---|
| 29 | #ifdef DEBUG_TWITTER |
---|
| 30 | #define debug( text... ) imcb_log( ic, text ); |
---|
| 31 | #else |
---|
| 32 | #define debug( text... ) |
---|
| 33 | #endif |
---|
| 34 | |
---|
[d6aa6dd] | 35 | typedef enum |
---|
| 36 | { |
---|
| 37 | TWITTER_HAVE_FRIENDS = 1, |
---|
| 38 | } twitter_flags_t; |
---|
| 39 | |
---|
[1b221e0] | 40 | struct twitter_data |
---|
| 41 | { |
---|
| 42 | char* user; |
---|
| 43 | char* pass; |
---|
[c42e8b9] | 44 | struct oauth_info *oauth_info; |
---|
[1b221e0] | 45 | guint64 home_timeline_id; |
---|
[7b87539] | 46 | guint64 last_status_id; /* For undo */ |
---|
[2abceca] | 47 | gint main_loop_id; |
---|
[b4dd253] | 48 | struct groupchat *home_timeline_gc; |
---|
[3bd4a93] | 49 | gint http_fails; |
---|
[d6aa6dd] | 50 | twitter_flags_t flags; |
---|
[bb5ce4d1] | 51 | |
---|
| 52 | gboolean url_ssl; |
---|
| 53 | int url_port; |
---|
| 54 | char *url_host; |
---|
| 55 | char *url_path; |
---|
[ffcdf13] | 56 | |
---|
| 57 | char *prefix; /* Used to generate contact + channel name. */ |
---|
[1b221e0] | 58 | }; |
---|
| 59 | |
---|
[203a2d2] | 60 | struct twitter_user_data |
---|
| 61 | { |
---|
| 62 | guint64 last_id; |
---|
| 63 | time_t last_time; |
---|
| 64 | }; |
---|
| 65 | |
---|
[62d2cfb] | 66 | /** |
---|
| 67 | * This has the same function as the msn_connections GSList. We use this to |
---|
| 68 | * make sure the connection is still alive in callbacks before we do anything |
---|
| 69 | * else. |
---|
| 70 | */ |
---|
[9c9a29c] | 71 | extern GSList *twitter_connections; |
---|
[62d2cfb] | 72 | |
---|
[d6aa6dd] | 73 | void twitter_login_finish( struct im_connection *ic ); |
---|
| 74 | |
---|
[1b221e0] | 75 | #endif //_TWITTER_H |
---|