EionRobb / purple-mattermost

A libpurple/Pidgin plugin for Mattermost
GNU General Public License v3.0
93 stars 23 forks source link

Problems with team_id being empty #114

Open thorgrin opened 5 years ago

thorgrin commented 5 years ago

I've recently pushed a fix for links to files which handles team_id being an empty string. However, it is probably a bigger problem as stated by

        //FIXME: in v4 api team_id is NULL for group chats, that breaks the code in many places.
        //       should be rewritten.

        //if (team_id == NULL || strlen(team_id) == 0) {
        //  team_id = mm_get_first_team_id(ma);
        //}

What would happen when we added this check whenever ma->channel_teams is written to? I've tried it and it solved my problem at a root, but there are probably side effects which I cannot see.