Changeset c43146d
- Timestamp:
- 2015-05-03T16:47:19Z (10 years ago)
- Branches:
- master
- Children:
- 5ca1416
- Parents:
- cd60710
- Location:
- protocols/twitter
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter.c
rcd60710 rc43146d 867 867 } 868 868 869 bee_user_t twitter_log_local_user; 870 869 871 /** Convert the given bitlbee tweet ID, bitlbee username, or twitter tweet ID 870 872 * into a twitter tweet ID. … … 897 899 bu = td->log[id].bu; 898 900 id = td->log[id].id; 899 /* Beware of dangling pointers! */900 if (!g_slist_find(ic->bee->users, bu)) {901 bu = NULL;902 }903 901 } else if (twitter_parse_id(arg, 10, &id)) { 904 902 /* Allow normal tweet IDs as well; not a very useful … … 911 909 } 912 910 if (bu_) { 911 if (bu == &twitter_log_local_user) { 912 /* HACK alert. There's no bee_user object for the local 913 * user so just fake one for the few cmds that need it. */ 914 twitter_log_local_user.handle = td->user; 915 } else { 916 /* Beware of dangling pointers! */ 917 if (!g_slist_find(ic->bee->users, bu)) { 918 bu = NULL; 919 } 920 } 913 921 *bu_ = bu; 914 922 } -
protocols/twitter/twitter.h
rcd60710 rc43146d 101 101 struct twitter_log_data { 102 102 guint64 id; 103 struct bee_user *bu; /* DANGER: can be a dead pointer. Check it first. */ 103 /* DANGER: bu can be a dead pointer. Check it first. 104 * twitter_message_id_from_command_arg() will do this. */ 105 struct bee_user *bu; 104 106 }; 105 107 … … 110 112 */ 111 113 extern GSList *twitter_connections; 114 115 /** 116 * Evil hack: Fake bee_user which will always point at the local user. 117 * Sometimes used as a return value by twitter_message_id_from_command_arg. 118 * NOT thread safe but don't you dare to even think of ever making BitlBee 119 * threaded. :-) 120 */ 121 extern bee_user_t twitter_log_local_user; 112 122 113 123 void twitter_login_finish(struct im_connection *ic); -
protocols/twitter/twitter_lib.c
rcd60710 rc43146d 701 701 if (g_strcasecmp(txs->user->screen_name, td->user) == 0) { 702 702 td->log[td->log_id].id = txs->rt_id; 703 /* More useful than NULL. */ 704 td->log[td->log_id].bu = &twitter_log_local_user; 703 705 } 704 706
Note: See TracChangeset
for help on using the changeset viewer.