package de.fau.cs.mad.fablab.android.model;

import de.fau.cs.mad.fablab.rest.core.MailAddresses;
import de.fau.cs.mad.fablab.rest.myapi.DataApi;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class MailModel {
    private String mFeedbackMailAddress;
    private String mFablabMailAddress;

    public MailModel(DataApi dataApi) {
        dataApi.getMailAddresses(new Callback<MailAddresses>() {
            @Override
            public void success(MailAddresses mailAddresses, Response response) {
                mFeedbackMailAddress = mailAddresses.getFeedbackMail();
                mFablabMailAddress = mailAddresses.getFabLabMail();
            }

            @Override
            public void failure(RetrofitError error) {
                mFeedbackMailAddress = "";
                mFablabMailAddress = "";
            }
        });
    }

    public String getFeedbackMailAddress() {
        return mFeedbackMailAddress;
    }

    public String getFablabMailAddress() {
        return mFablabMailAddress;
    }
}

@@ -290,24 +290,29 @@
 kMailAddress
+ = %22%22
 ;%0A    privat
@@ -338,16 +338,21 @@
 lAddress
+ = %22%22
 ;%0A%0A    p
@@ -791,91 +791,8 @@
 ) %7B%0A
-                mFeedbackMailAddress = %22%22;%0A                mFablabMailAddress = %22%22;
 %0A   

Initialize mail addresses to prevent crashes