Changes in / [d2d2b80:b38f655]
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
configure
rd2d2b80 rb38f655 82 82 replace="\1+$timestamp+$branch+\2-\3-git" 83 83 84 BITLBEE_VERSION=$(cd $srcdir; git describe --long --tags | sed -r "s #$search#$replace#")84 BITLBEE_VERSION=$(cd $srcdir; git describe --long --tags | sed -r "s/$search/$replace/") 85 85 86 86 unset timestamp branch search replace -
irc.h
rd2d2b80 rb38f655 147 147 IRC_CHANNEL_TEMP = 2, /* Erase the channel when the user leaves, 148 148 and don't save it. */ 149 150 /* Show a placeholder of the channel in listings, but don't save it */151 IRC_CHANNEL_KEEP_PLACEHOLDER = 4,152 149 153 150 /* Hack: Set this flag right before jumping into IM when we expect -
irc_channel.c
rd2d2b80 rb38f655 276 276 if (ic->irc->status & USTATUS_SHUTDOWN) { 277 277 /* Don't do anything fancy when we're shutting down anyway. */ 278 } else if (ic->flags & IRC_CHANNEL_TEMP && !(ic->flags & IRC_CHANNEL_KEEP_PLACEHOLDER)) {278 } else if (ic->flags & IRC_CHANNEL_TEMP) { 279 279 irc_channel_free_soon(ic); 280 280 } else { -
irc_im.c
rd2d2b80 rb38f655 576 576 ic->data = c; 577 577 578 if (ic->topic == NULL) { 579 /* New channel with no preset topic - make up a generic one */ 580 topic = g_strdup_printf( 581 "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", 582 c->title); 583 irc_channel_set_topic(ic, topic, irc->root); 584 } else { 585 /* Preset topic from the channel we picked */ 586 topic = g_strdup(ic->topic); 587 } 588 589 g_free(c->topic); 590 c->topic = topic; /* Let groupchat borrow this pointer */ 578 topic = g_strdup_printf( 579 "BitlBee groupchat: \"%s\". Please keep in mind that root-commands won't work here. Have fun!", 580 c->title); 581 irc_channel_set_topic(ic, topic, irc->root); 582 g_free(topic); 591 583 592 584 return TRUE; … … 608 600 c->ui_data = NULL; 609 601 irc_channel_del_user(ic, ic->irc->user, IRC_CDU_KICK, "Chatroom closed by server"); 610 611 return TRUE;612 }613 614 static gboolean bee_irc_chat_placeholder_new(bee_t *bee, struct im_connection *ic, const char *handle,615 const char *name, const char *topic)616 {617 irc_t *irc = bee->ui_data;618 irc_channel_t *ircc;619 char *full_name = irc_channel_name_gen(irc, name);620 621 ircc = irc_channel_new(irc, full_name);622 623 set_setstr(&ircc->set, "type", "chat");624 set_setstr(&ircc->set, "chat_type", "placeholder");625 set_setstr(&ircc->set, "account", ic->acc->tag);626 set_setstr(&ircc->set, "room", (char *) handle);627 628 irc_channel_set_topic(ircc, topic, NULL);629 630 g_free(full_name);631 602 632 603 return TRUE; … … 855 826 static gboolean bee_irc_channel_chat_join(irc_channel_t *ic) 856 827 { 857 char *acc_s, *room , *chat_type;828 char *acc_s, *room; 858 829 account_t *acc; 859 830 860 chat_type = set_getstr(&ic->set, "chat_type"); 861 862 if (strcmp(chat_type, "room") != 0 && strcmp(chat_type, "placeholder") != 0) { 831 if (strcmp(set_getstr(&ic->set, "chat_type"), "room") != 0) { 863 832 return TRUE; 864 833 } … … 1016 985 struct irc_channel *ic = set->data; 1017 986 1018 ic->flags &= ~(IRC_CHANNEL_TEMP | IRC_CHANNEL_KEEP_PLACEHOLDER);1019 1020 987 if (strcmp(value, "groupchat") == 0) { 1021 988 ic->flags |= IRC_CHANNEL_TEMP; 1022 989 } else if (strcmp(value, "room") == 0) { 1023 // beep boop 1024 } else if (strcmp(value, "placeholder") == 0) { 1025 ic->flags |= IRC_CHANNEL_TEMP | IRC_CHANNEL_KEEP_PLACEHOLDER; 990 ic->flags &= ~IRC_CHANNEL_TEMP; 1026 991 } else { 1027 992 return NULL; … … 1107 1072 bee_irc_chat_new, 1108 1073 bee_irc_chat_free, 1109 bee_irc_chat_placeholder_new,1110 1074 bee_irc_chat_log, 1111 1075 bee_irc_chat_msg, -
protocols/bee.h
rd2d2b80 rb38f655 115 115 gboolean (*chat_new)(bee_t *bee, struct groupchat *c); 116 116 gboolean (*chat_free)(bee_t *bee, struct groupchat *c); 117 gboolean (*chat_placeholder_new)(bee_t *bee, struct im_connection *ic, const char *handle,118 const char *name, const char *topic);119 117 /* System messages of any kind. */ 120 118 gboolean (*chat_log)(bee_t *bee, struct groupchat *c, const char *text); … … 168 166 * user, too. */ 169 167 G_MODULE_EXPORT struct groupchat *imcb_chat_new(struct im_connection *ic, const char *handle); 170 G_MODULE_EXPORT void imcb_chat_placeholder_new(struct im_connection *ic, const char *handle, const char *name,171 const char *topic);172 168 G_MODULE_EXPORT void imcb_chat_name_hint(struct groupchat *c, const char *name); 173 169 G_MODULE_EXPORT void imcb_chat_free(struct groupchat *c); -
protocols/bee_chat.c
rd2d2b80 rb38f655 54 54 } 55 55 56 void imcb_chat_placeholder_new(struct im_connection *ic, const char *handle, const char *name, const char *topic)57 {58 bee_t *bee = ic->bee;59 60 if (bee->ui->chat_placeholder_new) {61 bee->ui->chat_placeholder_new(bee, ic, handle, name, topic);62 }63 }64 65 56 void imcb_chat_name_hint(struct groupchat *c, const char *name) 66 57 { -
protocols/jabber/hipchat.c
rd2d2b80 rb38f655 27 27 { 28 28 struct jabber_data *jd = ic->proto_data; 29 char *sep, *jid , *muc_host;29 char *sep, *jid; 30 30 31 31 jid = xt_find_attr(node, "jid"); 32 muc_host = xt_find_attr(node, "muc_host");33 32 34 33 sep = strchr(jid, '/'); … … 49 48 if (!jabber_get_roster(ic) || 50 49 !jabber_iq_disco_server(ic) || 51 !jabber_get_hipchat_profile(ic) || 52 !jabber_iq_disco_muc(ic, muc_host)) { 50 !jabber_get_hipchat_profile(ic)) { 53 51 return XT_ABORT; 54 52 } … … 94 92 95 93 } 96 97 int jabber_iq_disco_muc(struct im_connection *ic, char *muc_server)98 {99 struct xt_node *node;100 int st;101 102 imcb_log(ic, "Fetching MUC list");103 104 node = xt_new_node("query", NULL, NULL);105 xt_add_attr(node, "xmlns", XMLNS_DISCO_ITEMS);106 node = jabber_make_packet("iq", "get", muc_server, node);107 108 jabber_cache_add(ic, node, jabber_parse_muc_list);109 st = jabber_write_packet(ic, node);110 111 return st;112 }113 114 xt_status jabber_parse_muc_list(struct im_connection *ic, struct xt_node *node, struct xt_node *orig)115 {116 struct xt_node *query, *c;117 118 if (!(query = xt_find_node(node->children, "query"))) {119 imcb_log(ic, "Warning: Received NULL MUC list packet");120 return XT_HANDLED;121 }122 123 c = query->children;124 while ((c = xt_find_node(c, "item"))) {125 struct xt_node *c2;126 char *topic = NULL;127 char *jid = xt_find_attr(c, "jid");128 char *name = xt_find_attr(c, "name");129 130 imcb_log(ic, "Debug: adding MUC to channel list: %s - '%s'", jid, name);131 132 if ((c2 = xt_find_node_by_attr(c->children, "x", "xmlns", XMLNS_HIPCHAT_MUC)) &&133 (c2 = xt_find_node(c2->children, "topic"))) {134 topic = c2->text;135 }136 137 imcb_chat_placeholder_new(ic, jid, name, topic);138 c = c->next;139 }140 return XT_HANDLED;141 142 } -
protocols/jabber/jabber.h
rd2d2b80 rb38f655 243 243 #define XMLNS_HIPCHAT "http://hipchat.com" 244 244 #define XMLNS_HIPCHAT_PROFILE "http://hipchat.com/protocol/profile" 245 #define XMLNS_HIPCHAT_MUC "http://hipchat.com/protocol/muc#room"246 245 247 246 /* jabber.c */ … … 254 253 int jabber_get_roster(struct im_connection *ic); 255 254 int jabber_get_vcard(struct im_connection *ic, char *bare_jid); 256 int jabber_iq_disco_muc(struct im_connection *ic, char *muc_server);257 255 int jabber_add_to_roster(struct im_connection *ic, const char *handle, const char *name, const char *group); 258 256 int jabber_remove_from_roster(struct im_connection *ic, char *handle); … … 358 356 xt_status jabber_parse_hipchat_profile(struct im_connection *ic, struct xt_node *node, struct xt_node *orig); 359 357 xt_status hipchat_handle_success(struct im_connection *ic, struct xt_node *node); 360 xt_status jabber_parse_muc_list(struct im_connection *ic, struct xt_node *node, struct xt_node *orig);361 358 362 359 #endif
Note: See TracChangeset
for help on using the changeset viewer.