- Timestamp:
- 2016-11-19T07:32:48Z (8 years ago)
- Branches:
- master
- Children:
- a7baf40
- Parents:
- 9f03c47
- Location:
- protocols
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
r9f03c47 rb4f496e 13 13 14 14 # [SH] Program variables 15 objects = account.o bee.o bee_chat.o bee_ft.o bee_user.o nogaim.o 15 objects = account.o bee.o bee_chat.o bee_ft.o bee_user.o nogaim.o unknown.o 16 16 17 17 -
protocols/nogaim.c
r9f03c47 rb4f496e 160 160 GList *protocols = NULL; 161 161 GList *disabled_protocols = NULL; 162 static struct prpl *unknown_prpl; 162 163 163 164 void register_protocol(struct prpl *p) … … 191 192 } 192 193 194 struct prpl *make_unknown_protocol(const char *name) 195 { 196 struct prpl *ret = g_memdup(unknown_prpl, sizeof(struct prpl)); 197 ret->name = g_strdup(name); 198 register_protocol(ret); 199 return ret; 200 } 201 193 202 gboolean is_protocol_disabled(const char *name) 194 203 { 195 204 return g_list_find_custom(disabled_protocols, name, proto_name_cmp) != NULL; 205 } 206 207 /* Returns heap allocated string with text attempting to explain why a protocol is missing 208 * Free the return value with g_free() */ 209 char *explain_unknown_protocol(const char *name) 210 { 211 char *extramsg = NULL; 212 213 if (is_protocol_disabled(name)) { 214 return g_strdup("Protocol disabled in the global config (bitlbee.conf)"); 215 } 216 217 if (strcmp(name, "yahoo") == 0) { 218 return g_strdup("The old yahoo protocol is gone, try the funyahoo++ libpurple plugin instead."); 219 } 220 221 #ifdef WITH_PURPLE 222 if ((strcmp(name, "msn") == 0) || 223 (strcmp(name, "loubserp-mxit") == 0) || 224 (strcmp(name, "myspace") == 0)) { 225 return g_strdup("This protocol has been removed from your libpurple version."); 226 } 227 228 if (strcmp(name, "hipchat") == 0) { 229 return g_strdup("This account type isn't supported by libpurple's jabber."); 230 } 231 232 #else 233 if (strcmp(name, "aim") == 0 || strcmp(name, "icq") == 0) { 234 return g_strdup("This account uses libpurple specific aliases for oscar. " 235 "Re-add the account with `account add oscar ...'"); 236 } 237 238 extramsg = "If this is a libpurple plugin, you might need to install bitlbee-libpurple instead."; 239 #endif 240 return g_strconcat("The protocol plugin is not installed or could not be loaded. " 241 "Use the `plugins' command to list available protocols. ", 242 extramsg, NULL); 196 243 } 197 244 … … 204 251 extern void twitter_initmodule(); 205 252 extern void purple_initmodule(); 253 extern void unknown_prpl_initmodule(); 254 255 unknown_prpl_initmodule(&unknown_prpl); 206 256 207 257 #ifdef WITH_MSN -
protocols/nogaim.h
r9f03c47 rb4f496e 159 159 /* The protocol is not suitable for OTR, see OPT_NOOTR */ 160 160 PRPL_OPT_NOOTR = 1 << 12, 161 162 /* This prpl is a placeholder for a missing protocol */ 163 PRPL_OPT_UNKNOWN_PROTOCOL = 1 << 13, 161 164 } prpl_options_t; 162 165 … … 321 324 G_MODULE_EXPORT struct prpl *find_protocol(const char *name); 322 325 G_MODULE_EXPORT gboolean is_protocol_disabled(const char *name); 326 G_MODULE_EXPORT struct prpl *make_unknown_protocol(const char *name); 327 G_MODULE_EXPORT char *explain_unknown_protocol(const char *name); 323 328 /* When registering a new protocol, you should allocate space for a new prpl 324 329 * struct, initialize it (set the function pointers to point to your
Note: See TracChangeset
for help on using the changeset viewer.