libpurple/protocols/irc/msgs.c

branch
soc.2013.gobjectification
changeset 34746
dc9c911dbd35
parent 34728
8efd73063ecf
child 34750
826c1611ef90
equal deleted inserted replaced
34745:111757790de8 34746:dc9c911dbd35
92 if ((gc = purple_account_get_connection(irc->account)) == NULL 92 if ((gc = purple_account_get_connection(irc->account)) == NULL
93 || PURPLE_CONNECTION_IS_CONNECTED(gc)) 93 || PURPLE_CONNECTION_IS_CONNECTED(gc))
94 return; 94 return;
95 95
96 purple_connection_set_display_name(gc, nick); 96 purple_connection_set_display_name(gc, nick);
97 purple_connection_set_state(gc, PURPLE_CONNECTED); 97 purple_connection_set_state(gc, PURPLE_CONNECTION_CONNECTED);
98 account = purple_connection_get_account(gc); 98 account = purple_connection_get_account(gc);
99 99
100 /* If we're away then set our away message */ 100 /* If we're away then set our away message */
101 status = purple_account_get_active_status(irc->account); 101 status = purple_account_get_active_status(irc->account);
102 if (purple_status_type_get_primitive(purple_status_get_type(status)) != PURPLE_STATUS_AVAILABLE) { 102 if (purple_status_type_get_primitive(purple_status_get_type(status)) != PURPLE_STATUS_AVAILABLE) {
1153 } 1153 }
1154 1154
1155 void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args) 1155 void irc_msg_badnick(struct irc_conn *irc, const char *name, const char *from, char **args)
1156 { 1156 {
1157 PurpleConnection *gc = purple_account_get_connection(irc->account); 1157 PurpleConnection *gc = purple_account_get_connection(irc->account);
1158 if (purple_connection_get_state(gc) == PURPLE_CONNECTED) { 1158 if (purple_connection_get_state(gc) == PURPLE_CONNECTION_CONNECTED) {
1159 purple_notify_error(gc, _("Invalid nickname"), 1159 purple_notify_error(gc, _("Invalid nickname"),
1160 _("Invalid nickname"), 1160 _("Invalid nickname"),
1161 _("Your selected nickname was rejected by the server. It probably contains invalid characters.")); 1161 _("Your selected nickname was rejected by the server. It probably contains invalid characters."));
1162 1162
1163 } else { 1163 } else {
1173 PurpleConnection *gc = purple_account_get_connection(irc->account); 1173 PurpleConnection *gc = purple_account_get_connection(irc->account);
1174 1174
1175 if (!args || !args[1]) 1175 if (!args || !args[1])
1176 return; 1176 return;
1177 1177
1178 if (gc && purple_connection_get_state(gc) == PURPLE_CONNECTED) { 1178 if (gc && purple_connection_get_state(gc) == PURPLE_CONNECTION_CONNECTED) {
1179 /* We only want to do the following dance if the connection 1179 /* We only want to do the following dance if the connection
1180 has not been successfully completed. If it has, just 1180 has not been successfully completed. If it has, just
1181 notify the user that their /nick command didn't go. */ 1181 notify the user that their /nick command didn't go. */
1182 buf = g_strdup_printf(_("The nickname \"%s\" is already being used."), 1182 buf = g_strdup_printf(_("The nickname \"%s\" is already being used."),
1183 irc->reqnick); 1183 irc->reqnick);

mercurial